Add NPE check to getSystemWindowInsets

Bug: 15452706
Change-Id: Ica83593eadd0155e1370dba268a9f15ad0affa7d
This commit is contained in:
Justin Koh
2014-06-06 12:13:16 -07:00
parent a5de8479f4
commit eba8782a1f

View File

@ -87,7 +87,12 @@ public final class WindowInsets {
if (mTempRect == null) {
mTempRect = new Rect();
}
mTempRect.set(mSystemWindowInsets);
if (mSystemWindowInsets != null) {
mTempRect.set(mSystemWindowInsets);
} else {
// If there were no system window insets, this is just empty.
mTempRect.setEmpty();
}
return mTempRect;
}