From abb9736684a9423349f2f5bc70e2778b4cdb7655 Mon Sep 17 00:00:00 2001 From: Jakub Skoczen Date: Thu, 3 Mar 2011 10:30:50 +0100 Subject: [PATCH] Avoid empty arrays when splitting --- mkdru.client.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mkdru.client.js b/mkdru.client.js index ddda649..0044663 100644 --- a/mkdru.client.js +++ b/mkdru.client.js @@ -145,8 +145,9 @@ mkdru.pz2Term = function (data) { // map all facets against selected, for simple rendering var hash = $.deparam.fragment(); for (var key in hash) { - if (key.indexOf('limit') == 0) //always wrap in array - hash[key.substr(6)] = hash[key].split(';'); + if (key.indexOf('limit') == 0 && hash[key]) + //always wrap in array + hash[key.substr(6)] = hash[key].split(/;+/); delete hash[key]; } for (var facet in mkdru.facets) { -- 1.7.10.4