From c922a97f9810321eb6812cf52c463454617b82d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Smodi=C5=A1?= Date: Fri, 18 Sep 2015 16:34:54 +0200 Subject: Don't crash loading a python problem, if the problem has no plan set. --- js/codeq/python.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/codeq') diff --git a/js/codeq/python.js b/js/codeq/python.js index 1d4ee17..a8d4c95 100644 --- a/js/codeq/python.js +++ b/js/codeq/python.js @@ -321,7 +321,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