added fix for null pointer expection
Merge pull request #274 from sheebans/master

added fix for null pointer expection