Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 9d6a1ad

Browse files
internalsystemerrorweierophinney
authored andcommitted
Fix null value throwing error
This fixes: #40
1 parent 8a9e110 commit 9d6a1ad

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Renderer/XmlRenderer.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ private function normalizeConstantValue($value)
101101
{
102102
$value = $value === true ? 'true' : $value;
103103
$value = $value === false ? 'false' : $value;
104-
$value = $value === null ? '' : $value;
105104
return $value;
106105
}
107106

@@ -115,6 +114,10 @@ private function isAssocArray(array $value) : bool
115114
*/
116115
private function createResourceElement(DOMDocument $doc, string $name, $data)
117116
{
117+
if ($data === null) {
118+
return $doc->createElement($name, $data);
119+
}
120+
118121
if (is_scalar($data)) {
119122
$data = $this->normalizeConstantValue($data);
120123
return $doc->createElement($name, $data);

0 commit comments

Comments
 (0)