Problem/Motivation
The bundle filter which was introduced in the entity parameter converter doesn't check if an entity exists before calling methods on it, resulting in a fatal error when a non-existing entity ID is passed in:
Error: Call to a member function bundle() on null in core/lib/Drupal/Core/ParamConverter/EntityConverter.php:145
Steps to reproduce
Pass a non-existing entity ID and a bundle filter to EntityConverter::convert()
.
Proposed resolution
Don't call methods on nullable objects without checking if they are NULL
.
Remaining tasks
Review and commit.
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
N/A