mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Ensure document is not falsey before attempting to clone it
This commit is contained in:
parent
074cf04b60
commit
7ea218aa1c
@ -35,7 +35,11 @@ abstract class HTMLValue extends ViewableData
|
||||
*/
|
||||
public function getContent()
|
||||
{
|
||||
$doc = clone $this->getDocument();
|
||||
$document = $this->getDocument();
|
||||
if (!$document) {
|
||||
return '';
|
||||
}
|
||||
$doc = clone $document;
|
||||
$xp = new DOMXPath($doc);
|
||||
|
||||
// If there's no body, the content is empty string
|
||||
|
Loading…
Reference in New Issue
Block a user