diff --git a/Sources/uYouPlusPatches.xm b/Sources/uYouPlusPatches.xm index 37f394752f..53812dd468 100644 --- a/Sources/uYouPlusPatches.xm +++ b/Sources/uYouPlusPatches.xm @@ -159,12 +159,14 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity) { - (BOOL)handleCommand:(id)command entry:(id)_entry fromView:(id)_fromView sender:(id)_sender completionBlock:(id)_completionBlock { GPBExtensionDescriptor *shareEntityEndpointDescriptor = [%c(YTIShareEntityEndpoint) shareEntityEndpoint]; if (![command hasExtension:shareEntityEndpointDescriptor]) + return %orig; + YTIShareEntityEndpoint *shareEntityEndpoint = [command getExtension:shareEntityEndpointDescriptor]; + if(!shareEntityEndpoint || !shareEntityEndpoint.hasSerializedShareEntity || !shareEntityEndpoint.serializedShareEntity) { return %orig; - YTIShareEntityEndpoint *shareEntityEndpoint = [command getExtension:shareEntityEndpointDescriptor]; - if(!shareEntityEndpoint.hasSerializedShareEntity) - return %orig; - if (!showNativeShareSheet(shareEntityEndpoint.serializedShareEntity)) + } + if (!showNativeShareSheet(shareEntityEndpoint.serializedShareEntity)) { return %orig; + } return TRUE; } %end