NPE fix #364
Merge pull request #369 from dlsniper/fix-364

NPE fix #364