Fix incorrect parameter in NULL check