瀏覽代碼

Prevent undefined error

Amauri CHAMPEAUX 10 年之前
父節點
當前提交
e9d7264829
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      tarteaucitron.js

+ 5 - 0
tarteaucitron.js

@@ -92,6 +92,11 @@ var tarteaucitron = {
                     }
                     }
                     return out;
                     return out;
                 }
                 }
+                
+                if (tarteaucitron.job === undefined) {
+                    return;
+                }
+                
                 tarteaucitron.job = cleanArray(tarteaucitron.job);
                 tarteaucitron.job = cleanArray(tarteaucitron.job);
                 tarteaucitron.job = tarteaucitron.job.sort(function (a, b) {
                 tarteaucitron.job = tarteaucitron.job.sort(function (a, b) {
                     if (s[a].type + s[a].key > s[b].type + s[b].key) { return 1; }
                     if (s[a].type + s[a].key > s[b].type + s[b].key) { return 1; }