mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 06:28:30 +00:00
If source undefined return default
This commit is contained in:
parent
3c423b5b7d
commit
304dfe3318
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue