NPE fix #364

This fixes the reported NPE.