Skip to content

Commit

Permalink
Third time's a charm
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarpsvo committed Feb 27, 2024
1 parent fadbc01 commit d02be48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.5.4] - 27-02-2024

### Changed

- Fixed issue with (soft-)deleted models throwing an exception when rendering field

## [4.5.3] - 27-02-2024

### Changed
Expand Down
2 changes: 1 addition & 1 deletion src/Multiselect.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public function setOptionsFromModels(Collection $models, $resourceClass)
$models
->mapInto($resourceClass)
->mapWithKeys(function ($associatedResource) {
$keyName = $this->keyName ?? $associatedResource->getKeyName() ?? null;
$keyName = $this->keyName ?? ($associatedResource ? $associatedResource->getKeyName() : null);
if (!$keyName) return null;

$resourceKey = $associatedResource->{$keyName};
Expand Down

0 comments on commit d02be48

Please sign in to comment.