incorrect null handling fix