Skip to content

Commit

Permalink
Do not send nil in iOS paste method
Browse files Browse the repository at this point in the history
  • Loading branch information
alberto lalama committed Jan 30, 2018
1 parent 389f3c5 commit a98a559
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ios/CDVClipboard.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ - (void)paste:(CDVInvokedUrlCommand*)command {
[self.commandDelegate runInBackground:^{
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
NSString *text = [pasteboard valueForPasteboardType:@"public.text"];
if (text == nil) {
text = @"";
}

CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:text];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
Expand Down

0 comments on commit a98a559

Please sign in to comment.