handle case when object is None.
Merge pull request #6 from ndurell/master

handle case when object is None.