diff options
-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; } |