Skip to content

Commit 6ab23d3

Browse files
author
Jonah Williams
authored
fix NPE in accessibility bridge (flutter#13255)
1 parent fd684c8 commit 6ab23d3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

shell/platform/android/io/flutter/view/AccessibilityBridge.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ public AccessibilityNodeInfo findFocus(int focus) {
10791079
*/
10801080
private SemanticsNode getRootSemanticsNode() {
10811081
if (BuildConfig.DEBUG && !flutterSemanticsTree.containsKey(0)) {
1082-
Log.e(TAG, "Attempted to getRootSemanticsNode without a root sematnics node.");
1082+
Log.e(TAG, "Attempted to getRootSemanticsNode without a root semantics node.");
10831083
}
10841084
return flutterSemanticsTree.get(0);
10851085
}
@@ -1140,6 +1140,9 @@ public boolean onAccessibilityHoverEvent(MotionEvent event) {
11401140
if (!accessibilityManager.isTouchExplorationEnabled()) {
11411141
return false;
11421142
}
1143+
if (flutterSemanticsTree.isEmpty()) {
1144+
return false;
1145+
}
11431146

11441147
SemanticsNode semanticsNodeUnderCursor = getRootSemanticsNode().hitTest(new float[] {event.getX(), event.getY(), 0, 1});
11451148
if (semanticsNodeUnderCursor.platformViewId != -1) {

0 commit comments

Comments
 (0)