Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid Fatal Error when the post author no longer exists. #10

Closed
kucrut opened this issue Mar 11, 2020 · 0 comments · Fixed by #11
Closed

Avoid Fatal Error when the post author no longer exists. #10

kucrut opened this issue Mar 11, 2020 · 0 comments · Fixed by #11
Assignees
Labels
bug Something isn't working

Comments

@kucrut
Copy link
Contributor

kucrut commented Mar 11, 2020

We had a fatal on single post view and found this line in the logs:

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to HM\MetaTags\JSONLD\get_person() must be an instance of WP_User, boolean given.

It turns out that the post author is set to a user that no longer exists on the site and this line assumes the get_user_by() call always return a WP_User object, when in fact, it could also return false on failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants