Skip to content

Commit

Permalink
fix(RCTBridge): Silence bundle progress parse errors
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentriemer committed May 26, 2018
1 parent 79a02bc commit 62ddca5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions packages/react-native-dom/ReactDom/bridge/RCTBridge.worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ function loadBundle(bundle) {
xmlHttp.onprogress = function(evt) {
const progressEvents = xmlHttp.response.match(/\{[\S]*\}/g);
if (progressEvents) {
const { done, total } = JSON.parse(
progressEvents[progressEvents.length - 1]
);

if (done && total) {
sendMessage("updateProgress", { done, total });
try {
const { done, total } = JSON.parse(
progressEvents[progressEvents.length - 1]
);
if (done && total) {
sendMessage("updateProgress", { done, total });
}
} catch (err) {
/* silence parse errors */
}
}
};
Expand Down

0 comments on commit 62ddca5

Please sign in to comment.