fixed NullReferenceException when _styles is not set

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