Skip to content

Commit 5f50456

Browse files
committed
[MOB-2234] - Fix for SDK Crash on inapp close
Added a check if message is null in case the message gets deleted in the background and gets synced with the app.
1 parent aa6e820 commit 5f50456

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

iterableapi/src/main/java/com/iterable/iterableapi/IterableInAppFragmentHTMLNotification.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,11 @@ public void onBackPressed() {
258258

259259
private void processMessageRemoval() {
260260
IterableInAppMessage message = IterableApi.sharedInstance.getInAppManager().getMessageById(messageId);
261+
if (message == null) {
262+
IterableLogger.e(TAG, "Message with id " + messageId + " does not exist");
263+
return;
264+
}
265+
261266
if (message.isMarkedForDeletion() && !message.isConsumed()) {
262267
IterableApi.sharedInstance.getInAppManager().removeMessage(message);
263268
}

0 commit comments

Comments
 (0)