Merge pull request #1479 from ecexplorer/master

Guard against NPE in deleteChannelGroup
This commit is contained in:
Michael Diarmid
2018-09-10 20:38:23 +01:00
committed by GitHub

View File

@@ -176,8 +176,13 @@ public class RNFirebaseNotifications extends ReactContextBaseJavaModule implemen
@ReactMethod
public void deleteChannelGroup(String channelId, Promise promise) {
notificationManager.deleteChannelGroup(channelId);
promise.resolve(null);
try {
notificationManager.deleteChannelGroup(channelId);
promise.resolve(null);
} catch (NullPointerException e) {
promise.reject("notifications/channel-group-not-found",
"The requested NotificationChannelGroup does not exist, have you created it?");
}
}
@ReactMethod