Skip to content
This repository was archived by the owner on Jun 3, 2021. It is now read-only.

Commit ba6d09c

Browse files
YorkShenlucky-chen
authored andcommitted
* [Android] Fix NPE in integer convert. (#2427)
1 parent 1349d21 commit ba6d09c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

android/sdk/src/main/java/com/taobao/weex/utils/WXUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public static int getInt(Object value) {
245245
return getInteger(value, 0);
246246
}
247247

248-
public static Integer getInteger(@Nullable Object value, @Nullable Integer df) {
248+
public static @Nullable Integer getInteger(@Nullable Object value, @Nullable Integer df) {
249249

250250
if (value == null) {
251251
return df;
@@ -308,7 +308,7 @@ public static Integer getInteger(@Nullable Object value, @Nullable Integer df) {
308308
WXLogUtils.e("Argument error! value is " + value, e);
309309
}
310310
}
311-
if (!ret.equals(df)) {
311+
if (ret != null && !ret.equals(df)) {
312312
sCache.put(key, ret);
313313
}
314314
return ret;

0 commit comments

Comments
 (0)