Commit 03f7a46b authored by tebjan's avatar tebjan
Browse files

cosmetics

parent 461a6c46
......@@ -232,29 +232,18 @@ namespace Svg
goto case XmlNodeType.EndElement;
}
if (element == null)
{
continue;
}
break;
case XmlNodeType.EndElement:
// Skip if no element was created and is not the closing tag for the last
// known element
SvgElement topElement = elementStack.Peek();
if (element == null && (topElement != null && reader.LocalName != topElement.ElementName))
{
continue;
}
// Pop the element out of the stack
element = elementStack.Pop();
if (value.Length > 0)
if (value.Length > 0 && element != null)
{
if (element != null)
element.Content = value.ToString();
element.Content = value.ToString();
// Reset content value for new element
value = new StringBuilder();
value.Clear();
}
break;
case XmlNodeType.CDATA:
......
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