From 2d6a27afa99003cc6eaceb4736c4f9a698a10cb0 Mon Sep 17 00:00:00 2001 From: ant Date: Tue, 6 May 2014 16:31:09 +0300 Subject: [PATCH] fix for multiple custom queries Check to see if queries is a property of the urlOptions object, before deleting the current input from the query. Without this check, the script was throwing an Uncaught TypeError: "Cannot convert undefined or null to object" when all the following conditions were met: 1. there is more than one custom queries 2. there is none currently in use 3. the user tries to use any, but the first one found by the selector in the dom (when using the first one found by the selector, the problem doesn't appear). Seems to be related with this issue: https://github.com/alfajango/jquery-dynatable/issues/73 --- jquery.dynatable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.dynatable.js b/jquery.dynatable.js index d08aba3..f9b0981 100644 --- a/jquery.dynatable.js +++ b/jquery.dynatable.js @@ -1594,7 +1594,7 @@ if (data[label][attr]) { if (typeof urlOptions[label] === 'undefined') { urlOptions[label] = {}; } urlOptions[label][attr] = data[label][attr]; - } else { + } else if(urlOptions[label]) { delete urlOptions[label][attr]; } }