Skip to content
Snippets Groups Projects
Commit eeb24cb5 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Include empty strings in fn isEmpty(val)

parent 11c7bfc8
Branches
No related tags found
2 merge requests!17Saddlegallmidge form idec 372,!12feat: Add test page (spatial) with mapserver layer in openlayers map
......@@ -521,13 +521,13 @@ function getUnix(aDate)
}
/**
* Saves a bit of typing. Currently checks if the val is either undefined or null
* Saves a bit of typing. Currently checks if the val is either undefined or null, and if a string == ""
* @param {Object} val
* @returns {Boolean} true if the value is considered empty
*/
function isEmpty(val)
{
return val === undefined || val === null;
return val === undefined || val === null || (typeof val === "string" && val.trim() == "");
}
// Keeping track of maps
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment