changeset 2248:9c7f09d3364d

Merge branch 'master' of https://github.com/BrechtDeMan/WebAudioEvaluationTool
author www-data <www-data@sucuk.dcs.qmul.ac.uk>
date Tue, 19 Apr 2016 12:21:11 +0100
parents d052405e29e2 (current diff) ae2bf6a1693e (diff)
children cd1126365aa3
files
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/js/core.js	Mon Apr 18 20:21:06 2016 +0100
+++ b/js/core.js	Tue Apr 19 12:21:11 2016 +0100
@@ -192,7 +192,7 @@
 		document.getElementsByTagName('body')[0].appendChild(errorNode[0]);
 		return;
 	}
-    if (responseDocument == undefined) {
+    if (responseDocument == undefined || responseDocument.firstChild == undefined) {
         var msg = document.createElement("h3");
 		msg.textContent = "FATAL ERROR";
 		var span = document.createElement("span");
@@ -202,7 +202,7 @@
 		document.getElementsByTagName('body')[0].appendChild(span);
 		return;
     }
-    if (responseDocument.children[0].nodeName == "waet") {
+    if (responseDocument.firstChild.nodeName == "waet") {
         // document is a specification
         
         // Perform XML schema validation
@@ -238,7 +238,7 @@
         // Generate the session-key
         storage.initialise();
         
-    } else if (responseDocument.children[0].nodeName == "waetresult") {
+    } else if (responseDocument.firstChild.nodeName == "waetresult") {
         // document is a result
         projectXML = document.implementation.createDocument(null,"waet");
         projectXML.children[0].appendChild(responseDocument.getElementsByTagName('waet')[0].getElementsByTagName("setup")[0].cloneNode(true));