It is notoriously annoying to get a deeper property from an object. If the parent does not exist, you get an error. So you need to stop getting to the property when a parent doe
Instead of try..catch, just test for the property:
function getProp(path, parent) { path = path.split('.'); for (var k=0, kLen=path.length; k