summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Deepanshu Gupta <deepanshu@google.com> 2015-05-28 21:59:08 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2015-05-28 21:59:12 +0000
commit5cd795a9094eb02c983751ecabca6f24b0a01c58 (patch)
treeafa5fee6ac1487ee474b24e5c47615e9cadbaa3e
parent1421583bca78ed1d2e22d091d64ae72352c4a9f5 (diff)
parentd758e042ce08c46712db3db2d63fc84795028dfe (diff)
Merge "Fix NPE in BridgeContext.obtainStyledAttributes()" into mnc-dev
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
index 9d2b884066ca..f03ec58f325a 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
@@ -130,6 +130,7 @@ public final class BridgeContext extends Context {
new IdentityHashMap<Object, Map<String,String>>();
// maps for dynamically generated id representing style objects (StyleResourceValue)
+ @Nullable
private Map<Integer, StyleResourceValue> mDynamicIdToStyleMap;
private Map<StyleResourceValue, Integer> mStyleToDynamicIdMap;
private int mDynamicIdGenerator = 0x02030000; // Base id for R.style in custom namespace
@@ -727,7 +728,7 @@ public final class BridgeContext extends Context {
}
}
} else if (defStyleRes != 0) {
- StyleResourceValue item = mDynamicIdToStyleMap.get(defStyleRes);
+ StyleResourceValue item = getStyleByDynamicId(defStyleRes);
if (item != null) {
defStyleValues = item;
} else {