Skip to content

Commit

Permalink
Merge "Fix NPE from onChildVisibilityChanged."
Browse files Browse the repository at this point in the history
  • Loading branch information
TreeHugger Robot authored and Android (Google) Code Review committed Oct 11, 2018
2 parents 5fe2996 + 254c25f commit 20c6621
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/java/android/view/View.java
Original file line number Diff line number Diff line change
Expand Up @@ -14255,9 +14255,10 @@ void setFlags(int flags, int mask) {
}

if (mParent instanceof ViewGroup) {
((ViewGroup) mParent).onChildVisibilityChanged(this,
(changed & VISIBILITY_MASK), newVisibility);
((View) mParent).invalidate(true);
ViewGroup parent = (ViewGroup) mParent;
parent.onChildVisibilityChanged(this, (changed & VISIBILITY_MASK),
newVisibility);
parent.invalidate(true);
} else if (mParent != null) {
mParent.invalidateChild(this, null);
}
Expand Down

0 comments on commit 20c6621

Please sign in to comment.