From da92df9761b52f6d24d2241080121cc5bef5e932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Smodi=C5=A1?= Date: Fri, 18 Sep 2015 16:41:12 +0200 Subject: Don't crash loading a prolog problem, if the problem has no plan set. --- js/codeq/prolog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js') diff --git a/js/codeq/prolog.js b/js/codeq/prolog.js index 4eed354..be4791a 100644 --- a/js/codeq/prolog.js +++ b/js/codeq/prolog.js @@ -371,7 +371,7 @@ editor.setValue(info.solution); $('#title').text(problem.slug); jqDescription.html(problem.description); - $('#btn_code_plan').prop('disabled', problem.plan.length == 0); + $('#btn_code_plan').prop('disabled', (problem.plan || '').length == 0); editor.on('change', function (instance, changeObj) { var doc = editor.getDoc(), -- cgit v1.2.1