Merge pull request #6 from Jygsaw/master

(cleanup) Check before calling property of uninitialized var