Skip to content

Conversation

@mikebronner
Copy link
Contributor

I came across this error today after enabling models collector. (Thanks btw for this awesome feature @reinink!):

get_class() expects parameter 1 to be object, null given (View: /private/var/tmp/homepage-articles.indexmKf4EN)

Screen Shot 2019-08-27 at 8 09 41 AM

@reinink
Copy link
Contributor

reinink commented Aug 27, 2019

Weird, I didn't realize that the $models array could contain null values. When does that happen?

@mikebronner
Copy link
Contributor Author

This happens when I set the $with attribute on a model to include a polymorphic relationship that doesn't always exist.

@barryvdh barryvdh merged commit 837f2a9 into barryvdh:master Aug 27, 2019
@barryvdh
Copy link
Owner

Thanks!

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.

3 participants