Commit 94746802 authored by Markus Mayer's avatar Markus Mayer
Browse files

fixed NullReferenceException in TryGetAttribute when _styles dictionary is not...

fixed NullReferenceException in TryGetAttribute when _styles dictionary is not set to a valid reference
parent 086c1b1b
...@@ -89,7 +89,7 @@ namespace Svg ...@@ -89,7 +89,7 @@ namespace Svg
} }
if (this.CustomAttributes.TryGetValue(name, out value)) return true; if (this.CustomAttributes.TryGetValue(name, out value)) return true;
SortedDictionary<int, string> rules; SortedDictionary<int, string> rules;
if (_styles.TryGetValue(name, out rules)) if (_styles != null && _styles.TryGetValue(name, out rules))
{ {
// Get staged styles that are // Get staged styles that are
if (rules.TryGetValue(StyleSpecificity_InlineStyle, out value)) return true; if (rules.TryGetValue(StyleSpecificity_InlineStyle, out value)) return true;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment