Fixed unforeseen NPE
Merge pull request #1064 from bspkrs/patch-2

Fixed unforeseen NPE