Fixed null pointer expection
Merge pull request #315 from sheebans/master

Fixed null pointer exception