Correct IsNull check to prevent null values in log