Fix nullable object check