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

Commit

Permalink
* [Android] Fix NPE in integer convert. (#2427)
Browse files Browse the repository at this point in the history
  • Loading branch information
YorkShen authored and lucky-chen committed May 10, 2019
1 parent 1349d21 commit ba6d09c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions android/sdk/src/main/java/com/taobao/weex/utils/WXUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public static int getInt(Object value) {
return getInteger(value, 0);
}

public static Integer getInteger(@Nullable Object value, @Nullable Integer df) {
public static @Nullable Integer getInteger(@Nullable Object value, @Nullable Integer df) {

if (value == null) {
return df;
Expand Down Expand Up @@ -308,7 +308,7 @@ public static Integer getInteger(@Nullable Object value, @Nullable Integer df) {
WXLogUtils.e("Argument error! value is " + value, e);
}
}
if (!ret.equals(df)) {
if (ret != null && !ret.equals(df)) {
sCache.put(key, ret);
}
return ret;
Expand Down

0 comments on commit ba6d09c

Please sign in to comment.