Check for null ptr before use
Merge pull request #21 from maksqwe/null_ptr_fix

Check for null ptr before use