Change null check to include undefined and null.