When collection has no vars then dont try to collect them

(cherry picked from commit ee7528186f69e811b1b4db8e69ea2e4ec0ea2613)
This commit is contained in:
2023-08-13 11:00:40 +08:00
parent c6094566b4
commit 2c4eedbf8b

View File

@@ -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;
}