Fixes a potential NPE in View.
Calling getLocationOnScreen() before the View is attached to a window can throw an NPE. This change simply guards against the exception.
This commit is contained in:
@@ -7157,8 +7157,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
|
||||
getLocationInWindow(location);
|
||||
|
||||
final AttachInfo info = mAttachInfo;
|
||||
location[0] += info.mWindowLeft;
|
||||
location[1] += info.mWindowTop;
|
||||
if (info != null) {
|
||||
location[0] += info.mWindowLeft;
|
||||
location[1] += info.mWindowTop;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user