diff options
author | Diego Perez <diegoperez@google.com> | 2015-05-06 23:42:33 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-06 23:42:35 +0000 |
commit | 1bc7fb2dcc954caac78d3fc02eb98ec30658d4d0 (patch) | |
tree | 28547210132d8455cb6adf4204c3e5d5bfac8ca3 | |
parent | 4f8a999682fdb8b38ee5671b8a8f527569ebb5ff (diff) | |
parent | 6aa5a44d9b65ee608df03df29dad640258548f10 (diff) | |
download | frameworks_base-1bc7fb2dcc954caac78d3fc02eb98ec30658d4d0.zip frameworks_base-1bc7fb2dcc954caac78d3fc02eb98ec30658d4d0.tar.gz frameworks_base-1bc7fb2dcc954caac78d3fc02eb98ec30658d4d0.tar.bz2 |
Merge "Fix isThemeAppCompat NPE when using an invalid theme" into lmp-mr1-dev
-rw-r--r-- | tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java index b6516eb..68b3c1a 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java @@ -1199,15 +1199,15 @@ public class RenderSessionImpl extends RenderAction<SessionParams> { // between Theme.AppCompat.Light and Theme.AppCompat is Theme.Material (for v21). boolean isThemeAppCompat = false; for (int i = 0; i < 50; i++) { + if (defaultTheme == null) { + break; + } // for loop ensures that we don't run into cyclic theme inheritance. if (defaultTheme.getName().startsWith("Theme.AppCompat")) { isThemeAppCompat = true; break; } defaultTheme = resources.getParent(defaultTheme); - if (defaultTheme == null) { - break; - } } mIsThemeAppCompat = isThemeAppCompat; } |