# HG changeset patch # User www-data # Date 1461064871 -3600 # Node ID 9c7f09d3364d772c77e697f1e71415373b81658c # Parent d052405e29e20b953a163bd3af09452edcf59e44# Parent ae2bf6a1693eca7cab1e3f5d7b0c29ca6f283d08 Merge branch 'master' of https://github.com/BrechtDeMan/WebAudioEvaluationTool diff -r d052405e29e2 -r 9c7f09d3364d js/core.js --- 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));