diff --git a/src/XML/wsp/Policy.php b/src/XML/wsp/Policy.php index d60eb34..6d4c5be 100644 --- a/src/XML/wsp/Policy.php +++ b/src/XML/wsp/Policy.php @@ -161,7 +161,10 @@ public static function fromXML(DOMElement $xml): static public function toXML(DOMElement $parent = null): DOMElement { $e = parent::toXML($parent); - $e->setAttribute('Name', $this->getName()); + + if ($this->getName() !== null) { + $e->setAttribute('Name', $this->getName()); + } $this->getId()?->toXML($e);