Skip to content

Commit 71b4ac9

Browse files
committed
FIXED : #282 : problem converting docx to pdf
PHP Catchable fatal error: Argument 2 passed to DOMXPath::query() must be an instance of DOMNode, null given, called in /var/www/xxx/PhpWord/Reader/Word2007.php on line 145 and defined in /var/www/xxx/PhpWord/Shared/XMLReader.php on line 99, referer: XXX
1 parent 5c8e100 commit 71b4ac9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/PhpWord/Shared/XMLReader.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ public function getElements($path, \DOMElement $contextNode = null)
9696
$this->xpath = new \DOMXpath($this->dom);
9797
}
9898

99-
return $this->xpath->query($path, $contextNode);
99+
if (is_null($contextNode)) {
100+
return $this->xpath->query($path);
101+
} else {
102+
return $this->xpath->query($path, $contextNode);
103+
}
100104
}
101105

102106
/**

0 commit comments

Comments
 (0)