Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
c8bbb522
Unverified
Commit
c8bbb522
authored
Aug 25, 2020
by
Greg Spencer
Committed by
GitHub
Aug 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Protect against null context in release mode (#64474)
parent
ed65f5e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
actions.dart
packages/flutter/lib/src/widgets/actions.dart
+2
-2
No files found.
packages/flutter/lib/src/widgets/actions.dart
View file @
c8bbb522
...
@@ -454,7 +454,7 @@ class Actions extends StatefulWidget {
...
@@ -454,7 +454,7 @@ class Actions extends StatefulWidget {
// getElementForInheritedWidgetOfExactType. Returns true if the visitor found
// getElementForInheritedWidgetOfExactType. Returns true if the visitor found
// what it was looking for.
// what it was looking for.
static
bool
_visitActionsAncestors
(
BuildContext
context
,
bool
visitor
(
InheritedElement
element
))
{
static
bool
_visitActionsAncestors
(
BuildContext
context
,
bool
visitor
(
InheritedElement
element
))
{
InheritedElement
actionsElement
=
context
.
getElementForInheritedWidgetOfExactType
<
_ActionsMarker
>();
InheritedElement
actionsElement
=
context
?
.
getElementForInheritedWidgetOfExactType
<
_ActionsMarker
>();
while
(
actionsElement
!=
null
)
{
while
(
actionsElement
!=
null
)
{
if
(
visitor
(
actionsElement
)
==
true
)
{
if
(
visitor
(
actionsElement
)
==
true
)
{
break
;
break
;
...
@@ -463,7 +463,7 @@ class Actions extends StatefulWidget {
...
@@ -463,7 +463,7 @@ class Actions extends StatefulWidget {
// context.getElementForInheritedWidgetOfExactType will return itself if it
// context.getElementForInheritedWidgetOfExactType will return itself if it
// happens to be of the correct type.
// happens to be of the correct type.
final
BuildContext
parent
=
_getParent
(
actionsElement
);
final
BuildContext
parent
=
_getParent
(
actionsElement
);
actionsElement
=
parent
.
getElementForInheritedWidgetOfExactType
<
_ActionsMarker
>();
actionsElement
=
parent
?
.
getElementForInheritedWidgetOfExactType
<
_ActionsMarker
>();
}
}
return
actionsElement
!=
null
;
return
actionsElement
!=
null
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment