Skip to content

Commit e3b4289

Browse files
Fix FIRMessagingExtensionHelper crash when attachment == nil (#4689)
1 parent b68ad62 commit e3b4289

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Firebase/Messaging/FIRMessagingExtensionHelper.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ - (void)populateNotificationContent:(UNMutableNotificationContent *)content
4646
if (attachmentURL) {
4747
[self loadAttachmentForURL:attachmentURL
4848
completionHandler:^(UNNotificationAttachment *attachment) {
49-
self.bestAttemptContent.attachments = @[ attachment ];
49+
if (attachment != nil) {
50+
self.bestAttemptContent.attachments = @[ attachment ];
51+
}
5052
[self deliverNotification];
5153
}];
5254
} else {

0 commit comments

Comments
 (0)