The attribute map will not return NULL if the attribute does not exist. This is a property from the map-function.
However, many checks look for NULL and will crash later on when they cannot interact with the attribute. It happens e.g. if you want to get a value from an attribute which does not exist for this type of object.