If source undefined return default

This commit is contained in:
Richard Davey 2017-03-28 14:57:34 +01:00
parent 3c423b5b7d
commit 304dfe3318

View file

@ -4,7 +4,11 @@
var GetObjectValue = function (source, key, defaultValue)
{
if (key.indexOf('.'))
if (!source)
{
return defaultValue;
}
else if (key.indexOf('.'))
{
var keys = key.split('.');
var parent = source;