Skip to content

Conversation

driesvints
Copy link
Member

This is a backport of #35364 to Laravel 6 LTS.

* fix: use strict null check on morphTo type

* test: assert 0 relation_type is handled correctly
Copy link

@dmytro-laba dmytro-laba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, this will break the backwards compatibility for cases where $this->{$type} is empty string. At least in my project it throws an exception.
I'd suggest adding an explicit check for zero there (in addition to empty) or checking the length of $this->{$type}.

@taylorotwell taylorotwell merged commit 57797fa into 6.x Dec 4, 2020
@taylorotwell taylorotwell deleted the backport-issue branch December 4, 2020 14:27
This was referenced Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants