Checking that obj.value is defined

And not null because in some cases it can be undefined which will trigger an error.