diff options
| author | Justin Koh <justinkoh@google.com> | 2014-06-09 21:12:39 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2014-06-09 21:12:39 +0000 |
| commit | ce8c1086fbc42e80056b59d9dbbd6144cb85f20d (patch) | |
| tree | e5cbc7d505ef81fec4c92d9e0cd42d5a775ee0f9 /core/java/android | |
| parent | 2be4ddc403b55e3c5107609a2eaeed4ddc0f23f0 (diff) | |
| parent | eba8782a1f8412a3510fc78a71b843ef6e89bdbb (diff) | |
am eba8782a: Add NPE check to getSystemWindowInsets
* commit 'eba8782a1f8412a3510fc78a71b843ef6e89bdbb':
Add NPE check to getSystemWindowInsets
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/view/WindowInsets.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/java/android/view/WindowInsets.java b/core/java/android/view/WindowInsets.java index 294f4724c548..57e774eb0062 100644 --- a/core/java/android/view/WindowInsets.java +++ b/core/java/android/view/WindowInsets.java @@ -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; } |
