Fixed: Check if variable is plain object before using isEmptyObject()

pull/2/head
Erwin Molendijk 9 years ago
parent f353dc2c41
commit a33123469a

@ -40,7 +40,7 @@ angular.module('startContainer', ['ui.bootstrap'])
function rmEmptyKeys(col) { function rmEmptyKeys(col) {
for (var key in col) { for (var key in col) {
if (col[key] === null || col[key] === undefined || col[key] === '' || $.isEmptyObject(col[key]) || col[key].length === 0) { if (col[key] === null || col[key] === undefined || col[key] === '' || ($.isPlainObject(col[key]) && $.isEmptyObject(col[key])) || col[key].length === 0) {
delete col[key]; delete col[key];
} }
} }

Loading…
Cancel
Save