Skip to content

Commit cff498e

Browse files
authored
Merge pull request #96 from RyanMillerC/fix-masked-edge-attrs
Verify Edge attributes exist before setting
2 parents 07b8b3c + 40ac0ed commit cff498e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

diagrams/__init__.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -436,10 +436,13 @@ def __init__(
436436
for k, v in self._default_edge_attrs.items():
437437
self._attrs[k] = v
438438

439-
# Graphviz complaining about using label for edges, so replace it with xlabel.
440-
self._attrs["xlabel"] = label
441-
self._attrs["color"] = color
442-
self._attrs["style"] = style
439+
if label:
440+
# Graphviz complaining about using label for edges, so replace it with xlabel.
441+
self._attrs["xlabel"] = label
442+
if color:
443+
self._attrs["color"] = color
444+
if style:
445+
self._attrs["style"] = style
443446
self._attrs.update(attrs)
444447

445448
def __sub__(self, other: Union["Node", "Edge", List["Node"]]):

0 commit comments

Comments
 (0)