Skip to content

Commit

Permalink
fix(core-p2p): parse without base64ToBinaryReplacer on error
Browse files Browse the repository at this point in the history
  • Loading branch information
alessiodf authored and air1one committed Nov 18, 2020
1 parent 6fb4ab9 commit 8e41f06
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/core-p2p/src/utils/sc-codec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ export const decode = input => {

try {
return JSON.parse(message, base64ToBinaryReplacer);
} catch (err) {} // tslint:disable-line
} catch {
try {
return JSON.parse(message);
} catch {
//
}
}

return message;
};
Expand Down

0 comments on commit 8e41f06

Please sign in to comment.