Skip to content

Commit

Permalink
Merge pull request #35222 from pradeepmdk/fix/29743-android-attachmen…
Browse files Browse the repository at this point in the history
…t-crash1

Android-Attachments-App crashes on uploading specific PDF
  • Loading branch information
mountiny authored Feb 5, 2024
2 parents 7511ec4 + 8a37b8e commit 5398ee3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions patches/react-native-pdf+6.7.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/node_modules/react-native-pdf/index.js b/node_modules/react-native-pdf/index.js
index c05de52..bea7af8 100644
--- a/node_modules/react-native-pdf/index.js
+++ b/node_modules/react-native-pdf/index.js
@@ -367,11 +367,17 @@ export default class Pdf extends Component {
message[4] = message.splice(4).join('|');
}
if (message[0] === 'loadComplete') {
+ let tableContents;
+ try {
+ tableContents = message[4]&&JSON.parse(message[4]);
+ } catch(e) {
+ tableContents = message[4];
+ }
this.props.onLoadComplete && this.props.onLoadComplete(Number(message[1]), this.state.path, {
width: Number(message[2]),
height: Number(message[3]),
},
- message[4]&&JSON.parse(message[4]));
+ tableContents);
} else if (message[0] === 'pageChanged') {
this.props.onPageChanged && this.props.onPageChanged(Number(message[1]), Number(message[2]));
} else if (message[0] === 'error') {

0 comments on commit 5398ee3

Please sign in to comment.