Skip to content

Commit

Permalink
Merge pull request #284 from PSPDFKit/rad/fix-invalid-instant-json-pa…
Browse files Browse the repository at this point in the history
…yload-crash

Fix a crash that would occur when adding an invalid Instant JSON payload
  • Loading branch information
radazzouz authored Aug 28, 2019
2 parents eb2a80f + 40ee276 commit 40b46cb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion ios/RCTPSPDFKit/RCTPSPDFKitView.m
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ - (BOOL)addAnnotation:(id)jsonAnnotation error:(NSError *_Nullable *)error {
BOOL success = NO;
if (data) {
PSPDFAnnotation *annotation = [PSPDFAnnotation annotationFromInstantJSON:data documentProvider:documentProvider error:error];
success = [document addAnnotations:@[annotation] options:nil];
if (annotation) {
success = [document addAnnotations:@[annotation] options:nil];
}
}

if (!success) {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-pspdfkit",
"version": "1.25.5",
"version": "1.25.6",
"description": "A React Native module for the PSPDFKit library.",
"keywords": [
"react native",
Expand Down
2 changes: 1 addition & 1 deletion samples/Catalog/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Catalog",
"version": "1.25.5",
"version": "1.25.6",
"private": true,
"scripts": {
"start": "react-native start",
Expand Down

0 comments on commit 40b46cb

Please sign in to comment.