Skip to content

Commit

Permalink
patch fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pradeepmdk committed Feb 4, 2024
1 parent 3ab4e6e commit 8a37b8e
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 8a37b8e

Please sign in to comment.