summaryrefslogtreecommitdiffstats
path: root/tools/layoutlib
diff options
context:
space:
mode:
authorDiego Perez <diegoperez@google.com>2015-05-07 00:21:09 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-05-07 00:21:09 +0000
commit9efcb308615c0adaf418d430adabea3d271bcbb4 (patch)
treeb13623e8709738d4c85ad80ed0687d000a33362a /tools/layoutlib
parent9c9bcd3486d9f7557329dea90b3c5fa1bdace91c (diff)
parent21246bd92f54be468496848b659bf47f2522430a (diff)
downloadframeworks_base-9efcb308615c0adaf418d430adabea3d271bcbb4.zip
frameworks_base-9efcb308615c0adaf418d430adabea3d271bcbb4.tar.gz
frameworks_base-9efcb308615c0adaf418d430adabea3d271bcbb4.tar.bz2
am 21246bd9: am 8e75e307: am 1bc7fb2d: Merge "Fix isThemeAppCompat NPE when using an invalid theme" into lmp-mr1-dev
* commit '21246bd92f54be468496848b659bf47f2522430a': Fix isThemeAppCompat NPE when using an invalid theme
Diffstat (limited to 'tools/layoutlib')
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java6
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;
}