Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ImportedProjects
SVG
Commits
cc6b2f20
Commit
cc6b2f20
authored
Oct 01, 2014
by
Tebjan Halm
Browse files
Merge pull request #103 from sunsided/pull-requests/containsattribute-nullref
fixed NullReferenceException when _styles is not set
parents
d15e5419
94746802
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/SvgElement.cs
View file @
cc6b2f20
...
@@ -77,7 +77,7 @@ namespace Svg
...
@@ -77,7 +77,7 @@ namespace Svg
{
{
SortedDictionary
<
int
,
string
>
rules
;
SortedDictionary
<
int
,
string
>
rules
;
return
(
this
.
Attributes
.
ContainsKey
(
name
)
||
this
.
CustomAttributes
.
ContainsKey
(
name
)
||
return
(
this
.
Attributes
.
ContainsKey
(
name
)
||
this
.
CustomAttributes
.
ContainsKey
(
name
)
||
(
_styles
.
TryGetValue
(
name
,
out
rules
)
&&
(
rules
.
ContainsKey
(
StyleSpecificity_InlineStyle
)
||
rules
.
ContainsKey
(
StyleSpecificity_PresAttribute
)))
)
;
(
_styles
!=
null
&&
_styles
.
TryGetValue
(
name
,
out
rules
)
)
&&
(
rules
.
ContainsKey
(
StyleSpecificity_InlineStyle
)
||
rules
.
ContainsKey
(
StyleSpecificity_PresAttribute
)));
}
}
public
bool
TryGetAttribute
(
string
name
,
out
string
value
)
public
bool
TryGetAttribute
(
string
name
,
out
string
value
)
{
{
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment