Test against null to avoid object to boolean conversion.