From e9d7264829bc82b679ca3c79e8f233643049920b Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Wed, 18 Feb 2015 22:59:28 +0100 Subject: [PATCH] Prevent undefined error --- tarteaucitron.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tarteaucitron.js b/tarteaucitron.js index abd6308..d3fe3d5 100644 --- a/tarteaucitron.js +++ b/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; }