From 2c4eedbf8b76bb7434a4be955248014eb5dcf2ae Mon Sep 17 00:00:00 2001 From: Anthony Axenov Date: Sun, 13 Aug 2023 11:00:40 +0800 Subject: [PATCH] When collection has no vars then dont try to collect them (cherry picked from commit ee7528186f69e811b1b4db8e69ea2e4ec0ea2613) --- src/Exporters/Abstract/AbstractConverter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Exporters/Abstract/AbstractConverter.php b/src/Exporters/Abstract/AbstractConverter.php index 2c7f620..b5c15c2 100644 --- a/src/Exporters/Abstract/AbstractConverter.php +++ b/src/Exporters/Abstract/AbstractConverter.php @@ -71,7 +71,7 @@ abstract class AbstractConverter implements ConverterContract */ protected function setVariables(): static { - if ($this->collection->variable) { + if (isset($this->collection?->variable)) { foreach ($this->collection->variable as $var) { $this->vars["{{{$var->key}}}"] = $var->value; }