ensure object exists before accessing .get
Merge pull request #6 from EugenMayer/fixnullobject

ensure object exists before accessing .get