Skip to content

Commit

Permalink
Accept invalid info json
Browse files Browse the repository at this point in the history
  • Loading branch information
edubart committed Jun 21, 2024
1 parent 846efe2 commit c9d7603
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,12 @@ async function updateInfo(info) {
// Called by RIVEMU before the first frame.
function rivemu_on_begin(width, height, target_fps, total_frames, info_data) {
if (info_data.length > 0) {
let info = JSON.parse(textDecoder.decode(info_data));
updateInfo(info);
try {
let info = JSON.parse(textDecoder.decode(info_data));
updateInfo(info);
} catch(e) {
console.error(e);
}
}
lastFrame = 0;
lastTotalFrames = total_frames;
Expand Down

0 comments on commit c9d7603

Please sign in to comment.