Skip to content

Commit 5721d28

Browse files
close image picker only if it is opened
1 parent a0eaa46 commit 5721d28

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ios/SOSPicker.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,13 @@ -(void)assetsPickerControllerDidCancel:(GMImagePickerController *)picker
282282
}
283283

284284
- (void) closeImagePicker:(CDVInvokedUrlCommand *)command {
285+
if (self.imagePicker.presentingViewController) {
285286
CDVPluginResult* pluginResult = nil;
286287
NSArray* emptyArray = [NSArray array];
287288
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:emptyArray];
288289
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
289290
[self.imagePicker.presentingViewController dismissViewControllerAnimated:YES completion:nil];
291+
}
290292
}
291293

292-
293294
@end

0 commit comments

Comments
 (0)