PostMessage: Catch parsing errors
Change-Id: I844086c8641da5228e7dc817451456f0958be2a6 Reviewed-on: https://gerrit.libreoffice.org/72759 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
This commit is contained in:
parent
704a6e4cd7
commit
584352dae4
1 changed files with 8 additions and 1 deletions
|
@ -140,7 +140,14 @@ L.Map.WOPI = L.Handler.extend({
|
|||
return;
|
||||
}
|
||||
|
||||
var msg = JSON.parse(e.data);
|
||||
var msg;
|
||||
try {
|
||||
msg = JSON.parse(e.data);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return;
|
||||
}
|
||||
|
||||
if (msg.MessageId === 'Host_PostmessageReady') {
|
||||
// We already have a listener for this in loleaflet.html, so ignore it here
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue