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

@@ -552,9 +552,15 @@ define([
var userDoc = module.realtime.getUserDoc();
var newDoc = "";
if(userDoc !== "") {
var hjson = JSON.parse(userDoc);
if (typeof (hjson) !== 'object' || Array.isArray(hjson)) {
throw new Error("That realtime document is not compatible with the Code app");
}
newDoc = hjson.content;
if (hjson.highlightMode) {