Checking that obj.value is defined

And not null because in some cases it can be undefined which will trigger an error.
Merge pull request #308 from rickihastings/patch-1

Checking that obj.value is defined