You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.
Accessibility Insights for Android is using Axe-Android 0.2.0, and we're seeing a failure from inside axe-android. Specifically, some app pages (like FlipGrid's camera mode) contain nodes where accessibilityNodeInfo.getClassName() returns null. Talkback seems to have no difficulty with these apps, but axe-android throws the following (line numbers reference the 0.2.0 tag):
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.hashCode()' on a null object reference at
com.deque.axe.android.AxePropCalculator.getCalculatedProps(AxePropCalculator.java:56) at
com.deque.axe.android.AxeView.calculateProps(AxeView.java:429) at
com.deque.axe.android.AxeView.(AxeView.java:194) at
com.deque.axe.android.AxeView.(AxeView.java:208) at
com.deque.axe.android.AxeView$Builder.build(AxeView.java:156) at
The code in AxePropCalculator.getCalculatedProps() switches on className, which triggers a call to String.hashCode(), which throws if className happens to be null.
So the question: Is it valid for an AccessibilityNodeInfo object to return a null value for getClassName()? As far as I can tell, the Android developer docs don't specify whether or not this field can legitimately be null. If it can be null, then the switch statement probably needs to first check for a non-null value. If it can't be null, then perhaps that's a rule in and of itself.
Happy to provide a PR for this (including appropriate unit tests) if it's determined that null is a valid return value from getClassName().
The text was updated successfully, but these errors were encountered:
Accessibility Insights for Android is using Axe-Android 0.2.0, and we're seeing a failure from inside axe-android. Specifically, some app pages (like FlipGrid's camera mode) contain nodes where
accessibilityNodeInfo.getClassName()
returns null. Talkback seems to have no difficulty with these apps, but axe-android throws the following (line numbers reference the 0.2.0 tag):The code in
AxePropCalculator.getCalculatedProps()
switches onclassName
, which triggers a call toString.hashCode()
, which throws ifclassName
happens to be null.So the question: Is it valid for an AccessibilityNodeInfo object to return a null value for
getClassName()
? As far as I can tell, the Android developer docs don't specify whether or not this field can legitimately be null. If it can be null, then the switch statement probably needs to first check for a non-null value. If it can't be null, then perhaps that's a rule in and of itself.Happy to provide a PR for this (including appropriate unit tests) if it's determined that null is a valid return value from
getClassName()
.The text was updated successfully, but these errors were encountered: