Skip to content

Commit 2224eec

Browse files
committed
Fixes two possible crashes
1. when autoClear was not set in config 2. when exception is null
1 parent 19cedd7 commit 2224eec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

android/src/main/java/com/vydia/UploaderModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public void onError(Context context, UploadInfo uploadInfo, ServerResponse serve
159159
}
160160

161161
// Make sure we do not try to call getMessage() on a null object
162-
if(exception){
162+
if(exception != null){
163163
params.putString("error", exception.getMessage());
164164
}else{
165165
params.putString("error", "Unknown exception");
@@ -218,7 +218,7 @@ public void onCancelled(Context context, UploadInfo uploadInfo) {
218218
notificationConfig.setNotificationChannelId(notification.getString("notificationChannel"));
219219
}
220220

221-
if(notification.getBoolean("autoClear")){
221+
if(notification.hasKey("autoClear") && notification.getBoolean("autoClear")){
222222
notificationConfig.getCompleted().autoClear = true;
223223
}
224224

0 commit comments

Comments
 (0)