diff --git a/src/js/assignJS.js b/src/js/assignJS.js index a667c55cb1c909b47276bb99abf2fed8e909db6f..09dd10ee58a9d6cb4806ab6c3720ed57317bc59a 100644 --- a/src/js/assignJS.js +++ b/src/js/assignJS.js @@ -931,10 +931,10 @@ App.Utils.jobForAssignment = function() { if (map.size === 0) { fillMap(); } + if (!assignment) { + throw Error(`Can't find job object for assignment '${assignment}'`); + } return map.get(assignment); } - if (!assignment) { - throw Error(`Can't find job object for assignment '${assignment}'`); - } return getJob; }();