From f61bec84674e608f631468d97096ac1c957ce351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E6=A5=BD=E5=9D=82=E8=8A=B1=E7=81=AB?= Date: Wed, 27 Nov 2019 22:46:30 +0800 Subject: [PATCH] Pass "null" when copy data is null to iOS pasteboard.string (#14046) --- .../darwin/ios/framework/Source/FlutterPlatformPlugin.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm b/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm index 585d5a387..941e3945d 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm @@ -224,7 +224,11 @@ using namespace flutter; - (void)setClipboardData:(NSDictionary*)data { UIPasteboard* pasteboard = [UIPasteboard generalPasteboard]; - pasteboard.string = data[@"text"]; + if (data[@"text"]) { + pasteboard.string = data[@"text"]; + } else { + pasteboard.string = @"null"; + } } @end -- GitLab