diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index 24584f9f599fa..5093bedfa1f2b 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -1079,7 +1079,7 @@ public AccessibilityNodeInfo findFocus(int focus) { */ 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 boolean onAccessibilityHoverEvent(MotionEvent event) { 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) {