Skip to content

Commit 9822783

Browse files
committed
update DoubleKeyValueMap
1 parent 12d54f2 commit 9822783

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

library/src/com/lidroid/xutils/util/core/DoubleKeyValueMap.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@ public void put(K1 key1, K2 key2, V value) {
3838
if (key1 == null || key2 == null || value == null) return;
3939
if (k1_k2V_map.containsKey(key1)) {
4040
ConcurrentHashMap<K2, V> k2V_map = k1_k2V_map.get(key1);
41-
k2V_map.put(key2, value);
41+
if (k2V_map != null) {
42+
k2V_map.put(key2, value);
43+
} else {
44+
k2V_map = new ConcurrentHashMap<K2, V>();
45+
k2V_map.put(key2, value);
46+
k1_k2V_map.put(key1, k2V_map);
47+
}
4248
} else {
4349
ConcurrentHashMap<K2, V> k2V_map = new ConcurrentHashMap<K2, V>();
4450
k2V_map.put(key2, value);

0 commit comments

Comments
 (0)