Skip to content

Commit

Permalink
[8.x] Fix Eager loading partially nullable morphTo relations (#36129)
Browse files Browse the repository at this point in the history
* Filter non-empty keys by type

* Fix failed style check

* Remove unnecessary callback
  • Loading branch information
jan-demsar authored Feb 8, 2021
1 parent 6c77f47 commit 79b98fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/Relations/MorphTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ protected function gatherKeysByType($type, $keyType)
? array_keys($this->dictionary[$type])
: array_map(function ($modelId) {
return (string) $modelId;
}, array_keys($this->dictionary[$type]));
}, array_filter(array_keys($this->dictionary[$type])));
}

/**
Expand Down

0 comments on commit 79b98fe

Please sign in to comment.