-
Notifications
You must be signed in to change notification settings - Fork 133
fix(null checks): Better Null checking #291
Conversation
caf8389 to
6bb1eb6
Compare
| var _getObjectValue = function (object, path){ | ||
| if(!object) return; | ||
| path = path.split('.'); | ||
| var obj = object[path.shift()]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using while and shift should be quicker then forcibly iterating through everything via forEach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good...
…rols.layers.visible'
| var _controlLayersMustBeVisible = function(baselayers, overlays, mapId) { | ||
| var defaults = leafletMapDefaults.getDefaults(mapId); | ||
| if(!defaults.controls.layers.visible) { | ||
| if(!get(defaults, 'controls.layers.visible')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This kinda stuff is where I much prefer coffeescript... anyway using get to get a value as undefined regardless how nested.
nmccready
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were undefined errors happening against defaults.controls . These changes resolve that.
|
LGTM! |
No description provided.