prevent accessing property of null/undefined objects
Merge pull request #42 from gwokae/master

To prevent accessing properties of null/undefined object