Throw an error when trying to open a document with the wrong app

This commit is contained in:
yflory
2017-02-06 12:06:39 +01:00
parent ad82a275bc
commit 7d6e15e465
2 changed files with 10 additions and 0 deletions

View File

@@ -630,6 +630,10 @@ define([
var hjson = JSON.parse(userDoc);
newDoc = hjson.content;
if (typeof (hjson) !== 'object' || Array.isArray(hjson)) {
throw new Error("That realtime document is not compatible with the Slide app");
}
if (hjson.highlightMode) {
setMode(hjson.highlightMode, module.$language);
}