From c2048baf16fad78ad4cd7ecb6111e5c31a533d52 Mon Sep 17 00:00:00 2001 From: Eddie Kohler Date: Wed, 26 Jul 2023 11:32:50 -0400 Subject: [PATCH] Whoops --- src/documentinfo.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/documentinfo.php b/src/documentinfo.php index 0ee96995c3..6f7df5b95a 100644 --- a/src/documentinfo.php +++ b/src/documentinfo.php @@ -1525,11 +1525,14 @@ function metadata() { /** @param string $key * @param mixed $value */ function __set_metadata($key, $value) { - $m = $this->metadata() ?? (object) []; + $this->metadata(); + if ($this->_metadata === null) { + $this->_metadata = (object) []; + } if ($value !== null) { - $m->$key = $value; + $this->_metadata->$key = $value; } else { - unset($m->$key); + unset($this->_metadata->$key); } }