FIX: Warnings in Qunit suite

This commit is contained in:
Robin Ward 2013-11-13 14:26:14 -05:00
parent bda5a72c6a
commit 9cbfd8362d

View file

@ -12,10 +12,9 @@ function finderFor(filter, params) {
var url = Discourse.getURL("/") + filter + ".json"; var url = Discourse.getURL("/") + filter + ".json";
if (params) { if (params) {
var keys = Object.keys(params); var keys = Object.keys(params),
encoded = [];
if (keys.length > 0) {
var encoded = [];
keys.forEach(function(p) { keys.forEach(function(p) {
var value = params[p]; var value = params[p];
if (typeof value !== 'undefined') { if (typeof value !== 'undefined') {
@ -23,6 +22,7 @@ function finderFor(filter, params) {
} }
}); });
if (encoded.length > 0) {
url += "?" + encoded.join('&'); url += "?" + encoded.join('&');
} }
} }