Fix preventing unexpected NPE