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

[Orm] Uncaught ErrorException if EntityCollection->getById() called with invalid id #178

Open
avolutions opened this issue Jan 9, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@avolutions
Copy link
Member

Describe the bug
If EntityCollection->getById() is called with a not existing id, the following exception is thrown:

Uncaught ErrorException: Undefined array key 0

The method should return null (like getFirst()) instead of throwing an exception.

To Reproduce

  1. Create a model, mapping and EntityCollection
  2. Call EntityCollection->getById() and pass a not existing id

Additional information
AVOLUTIONS version: 0.9.0-alpha
PHP version: 8.0

@avolutions avolutions added the bug Something isn't working label Jan 9, 2022
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

No branches or pull requests

1 participant