Added nil check for object validation.
Merge pull request #32 from jcgsxr/fix/nsnull

Added nil check for object validation.