Skip to content

Commit

Permalink
fix crash issue (#791)
Browse files Browse the repository at this point in the history
  • Loading branch information
pradeepmdk authored Dec 1, 2023
1 parent 5df5a1b commit 45d462c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,18 @@ 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') {
Expand Down

0 comments on commit 45d462c

Please sign in to comment.