From 6c82e1ed7dec28ab125e685ae9d8dee8c9c0abe8 Mon Sep 17 00:00:00 2001 From: manuroe Date: Thu, 8 Mar 2018 16:48:33 +0100 Subject: [PATCH] Fix crash in ShareExtensionManager Reported in Xcode organiser so there is no detail how it happened. The fix is a workaround to avoid the crash but it does not help the user for sending their image. --- RiotShareExtension/Model/ShareExtensionManager.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/RiotShareExtension/Model/ShareExtensionManager.m b/RiotShareExtension/Model/ShareExtensionManager.m index e98dcb90d..a1422d3cb 100644 --- a/RiotShareExtension/Model/ShareExtensionManager.m +++ b/RiotShareExtension/Model/ShareExtensionManager.m @@ -221,7 +221,15 @@ typedef NS_ENUM(NSInteger, ImageCompressionMode) { typeof(self) self = weakSelf; itemProvider.isLoaded = YES; - [self.pendingImages addObject:imageData]; + + if (imageData) + { + [self.pendingImages addObject:imageData]; + } + else + { + NSLog(@"[ShareExtensionManager] sendContentToRoom: failed to loadItemForTypeIdentifier. Error: %@", error); + } if ([self areAttachmentsFullyLoaded]) {