fixed NullReferenceException when _styles is not set

Fixed a `NullReferenceException` that occurred in `ContainsAttribute(name)` when the `_styles` dictionary was not set to a valid reference.