Add missing check for null value