summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-03-01 20:30:56 +0100
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-03-01 20:30:56 +0100
commit8add00aa44fa0b4d7e83b3d6074140e87c628479 (patch)
tree1bca136235a9bf9b01a55d15a79d2200e9d9c472
parent0dbbbf9b10628d1aa51dee7c7155fa24e04848ab (diff)
Check that {prolog,python,robot}Handler exists before destroying it
-rw-r--r--js/codeq/prolog.js5
-rw-r--r--js/codeq/python.js5
-rw-r--r--js/codeq/robot.js5
3 files changed, 6 insertions, 9 deletions
diff --git a/js/codeq/prolog.js b/js/codeq/prolog.js
index 1b8d3c3..18e3fdd 100644
--- a/js/codeq/prolog.js
+++ b/js/codeq/prolog.js
@@ -47,8 +47,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
.fail(function (reason) {
codeq.log.error('Failed to obtain the problem definition: ' + reason, reason);
alert('Failed to obtain the problem definition: ' + reason);
-
- history.back();//TODO test
+ history.back();
})
.done();
},
@@ -59,7 +58,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
// end of experiment: Prolog hints
jqScreen.css('display', 'none');
- prologHandler.destroy();
+ if (prologHandler) prologHandler.destroy();
prologHandler = null;
$('#navigation-problem-list').css('display', 'none');
diff --git a/js/codeq/python.js b/js/codeq/python.js
index 893110b..05821e1 100644
--- a/js/codeq/python.js
+++ b/js/codeq/python.js
@@ -46,14 +46,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
.fail(function (reason) {
codeq.log.error('Failed to obtain the problem definition: ' + reason, reason);
alert('Failed to obtain the problem definition: ' + reason);
-
- history.back();//TODO test
+ history.back();
})
.done();
},
'exit': function () {
jqScreen.css('display', 'none');
- pythonHandler.destroy();
+ if (pythonHandler) pythonHandler.destroy();
pythonHandler = null;
$('#navigation-problem-list').css('display', 'none');
diff --git a/js/codeq/robot.js b/js/codeq/robot.js
index f64e4a0..70f7c5d 100644
--- a/js/codeq/robot.js
+++ b/js/codeq/robot.js
@@ -46,14 +46,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
.fail(function (reason) {
codeq.log.error('Failed to obtain the problem definition: ' + reason, reason);
alert('Failed to obtain the problem definition: ' + reason);
-
- history.back();//TODO test
+ history.back();
})
.done();
},
'exit': function () {
jqScreen.css('display', 'none');
- robotHandler.destroy();
+ if (robotHandler) robotHandler.destroy();
robotHandler = null;
$('#navigation-problem-list').css('display', 'none');