Add null check in ViewOverlay
View.getOverlay().clear() can failed with an NPE if there are no drawables in the overlay. Fix: add a null check before dereferencing the mDrawables field. Issue #8895794 getOverlay.clear() crashes if drawables were not added previously Change-Id: I9b2a63036450915681ba3a89a0911e2490063702
This commit is contained in:
@ -179,7 +179,9 @@ public class ViewOverlay {
|
||||
|
||||
public void clear() {
|
||||
removeAllViews();
|
||||
mDrawables.clear();
|
||||
if (mDrawables != null) {
|
||||
mDrawables.clear();
|
||||
}
|
||||
}
|
||||
|
||||
boolean isEmpty() {
|
||||
|
Reference in New Issue
Block a user