#307 extra check for NPE