Fixed null pointer exception
Merge pull request #688 from sheebans/master

Fixed null pointer exception