Ver código fonte

Prevent undefined error

Amauri CHAMPEAUX 10 anos atrás
pai
commit
e9d7264829
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5 0
      tarteaucitron.js

+ 5 - 0
tarteaucitron.js

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