# HG changeset patch # User Nicholas Jillings # Date 1505240636 -3600 # Node ID 9cdcde1dafd8b10b55ea132857bf3a90bc1f70d7 # Parent e2e189785bfa3008e0681f77eccd9b71ec6232c0# Parent 5d7e33fd00d84d4ce090f9792500ae1519a282e8 Merge branch 'master' into vnext diff -r e2e189785bfa -r 9cdcde1dafd8 js/core.js --- a/js/core.js Tue Sep 12 19:06:21 2017 +0100 +++ b/js/core.js Tue Sep 12 19:23:56 2017 +0100 @@ -837,7 +837,8 @@ node.response = null; var i = 0; var inputs = optHold.getElementsByTagName('input'); - while (node.response === null) { + var checked; + while (checked === undefined) { if (i == inputs.length) { if (node.specification.mandatory === true) { interfaceContext.lightbox.post("Error", "Please select one option"); @@ -846,11 +847,18 @@ break; } if (inputs[i].checked === true) { - node.response = node.specification.options[i]; - console.log("Selected: " + node.specification.options[i].name); + checked = inputs[i]; } i++; } + var option = node.specification.options.find(function (a) { + return checked.id == a.name; + }); + if (option === undefined) { + interfaceContext.lightbox.post("Error", "A configuration error has occured, the test cannot be continued"); + throw ("ERROR - Cannot find option"); + } + node.response = option; processConditional.call(this, node, node.response.name); return true; }