Merge pull request #1 from core9/master

null pointer fix