fix NPE in accessibility bridge (flutter/engine#13255)
This commit is contained in:
@@ -1079,7 +1079,7 @@ public class AccessibilityBridge extends AccessibilityNodeProvider {
|
||||
*/
|
||||
private SemanticsNode getRootSemanticsNode() {
|
||||
if (BuildConfig.DEBUG && !flutterSemanticsTree.containsKey(0)) {
|
||||
Log.e(TAG, "Attempted to getRootSemanticsNode without a root sematnics node.");
|
||||
Log.e(TAG, "Attempted to getRootSemanticsNode without a root semantics node.");
|
||||
}
|
||||
return flutterSemanticsTree.get(0);
|
||||
}
|
||||
@@ -1140,6 +1140,9 @@ public class AccessibilityBridge extends AccessibilityNodeProvider {
|
||||
if (!accessibilityManager.isTouchExplorationEnabled()) {
|
||||
return false;
|
||||
}
|
||||
if (flutterSemanticsTree.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SemanticsNode semanticsNodeUnderCursor = getRootSemanticsNode().hitTest(new float[] {event.getX(), event.getY(), 0, 1});
|
||||
if (semanticsNodeUnderCursor.platformViewId != -1) {
|
||||
|
||||
Reference in New Issue
Block a user