fixed NullReferenceException in TryGetAttribute when _styles dictionary is not set to a valid reference