Skip to content

Commit aca4639

Browse files
refactor
1 parent 5721d28 commit aca4639

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/ios/SOSPicker.m

+6-5
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) {
286-
CDVPluginResult* pluginResult = nil;
287-
NSArray* emptyArray = [NSArray array];
288-
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:emptyArray];
289-
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
285+
if (self.imagePicker && self.imagePicker.presentingViewController) {
290286
[self.imagePicker.presentingViewController dismissViewControllerAnimated:YES completion:nil];
287+
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:TRUE];
288+
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
289+
} else {
290+
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:FALSE];
291+
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
291292
}
292293
}
293294

0 commit comments

Comments
 (0)