Skip to content

Commit

Permalink
Fix crash on position being string (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
indykoning authored Mar 21, 2024
1 parent 71ec577 commit bc6b6b3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Models/Casts/CastAmastyLabelVariables.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public function get($model, string $key, $value, array $attributes): Collection
}

foreach (['cat_position', 'prod_position'] as $typeLabel) {
if (!is_int($labels[$key]->{$typeLabel})) {
continue;
}
$labels[$key]->{$typeLabel} = $this->getPositionName($labels[$key]->{$typeLabel});
}
}
Expand Down

0 comments on commit bc6b6b3

Please sign in to comment.