DO NOT MERGE - Fix NPE when requesting outsets for detached view.

Outsets are used during measure/layout pass, but this can be called on a
view that is not currently attached.


Bug: 21602590
Change-Id: I5860d5e7c20131e2650bdb8635e9659e76205fa1
(cherry picked from commit e660d4e96a)
This commit is contained in:
Filip Gruszczynski
2015-06-03 10:32:26 -07:00
committed by Michael Kwan
parent 45eb3ea667
commit c3d69a798e

View File

@@ -6672,7 +6672,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @hide
*/
public void getOutsets(Rect outOutsetRect) {
outOutsetRect.set(mAttachInfo.mOutsets);
if (mAttachInfo != null) {
outOutsetRect.set(mAttachInfo.mOutsets);
} else {
outOutsetRect.setEmpty();
}
}
/**