Skip to content

Commit dec5583

Browse files
committed
Some minor changes.
1 parent cd6116c commit dec5583

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ios/Classes/PspdfkitPlugin.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
3939
result([self getFormFieldValueForFieldWithFullyQualifiedName:fullyQualifiedName]);
4040
} else if ([@"applyInstantJson" isEqualToString:call.method]) {
4141
NSString *annotationsJson = call.arguments[@"annotationsJson"];
42-
if (annotationsJson == nil || annotationsJson.length <= 0) {
42+
if (annotationsJson.length == 0) {
4343
result([FlutterError errorWithCode:@"" message:@"annotationsJson may not be nil or empty." details:nil]);
4444
return;
4545
}
@@ -65,8 +65,8 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
6565
NSError *error;
6666
NSData *data = [document generateInstantJSONFromDocumentProvider:document.documentProviders.firstObject error:&error];
6767
NSString *annotationsJson = [[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding];
68-
if (annotationsJson == nil || annotationsJson.length <= 0 || error) {
69-
result([FlutterError errorWithCode:@"" message:@"Error while exporting document Instant JSON." details:nil]);
68+
if (annotationsJson == nil) {
69+
result([FlutterError errorWithCode:@"" message:@"Error while exporting document Instant JSON." details:error.localizedDescription]);
7070
} else {
7171
result(annotationsJson);
7272
}

0 commit comments

Comments
 (0)