When collection has no vars then dont try to collect them

(cherry picked from commit ee7528186f69e811b1b4db8e69ea2e4ec0ea2613)
This commit is contained in:
Anthony Axenov 2023-08-13 11:00:40 +08:00
parent c6094566b4
commit 2c4eedbf8b
Signed by: anthony
GPG Key ID: EA9EC32FF7CCD4EC

View File

@ -71,7 +71,7 @@ abstract class AbstractConverter implements ConverterContract
*/ */
protected function setVariables(): static protected function setVariables(): static
{ {
if ($this->collection->variable) { if (isset($this->collection?->variable)) {
foreach ($this->collection->variable as $var) { foreach ($this->collection->variable as $var) {
$this->vars["{{{$var->key}}}"] = $var->value; $this->vars["{{{$var->key}}}"] = $var->value;
} }