Skip to content

Commit 7c886ac

Browse files
Mindy PereiraAndroid (Google) Code Review
authored andcommitted
Merge "Perform null check on empty view before doing accessibility check."
2 parents a0e9d0f + f937313 commit 7c886ac

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

core/java/android/widget/AdapterView.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,8 @@ public void setEmptyView(View emptyView) {
650650
mEmptyView = emptyView;
651651

652652
// If not explicitly specified this view is important for accessibility.
653-
if (emptyView.getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
653+
if (emptyView != null
654+
&& emptyView.getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
654655
emptyView.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
655656
}
656657

0 commit comments

Comments
 (0)