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

Passing findOneOrFail(undefined) will not throw an error, it returns the current table's first entry. #6728

Closed
paroczigergo opened this issue Sep 16, 2020 · 4 comments

Comments

@paroczigergo
Copy link

Issue type:

[x] bug report
[ ] feature request
[ ] documentation issue

Database system/driver:

[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[x] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo

TypeORM version:

[] latest
[ ] @next
[ x] 0.2.25

Steps to reproduce or a small repository showing the problem:

Passing undefined value as id will not throw an error, it returns the current table's first entry.
repository.findOneOrFail(id)

Expectation:
It should throws an exception, and should not return db value.

@imnotjames
Copy link
Contributor

This is a breaking change which is ideally gonna happen in the next minor release

@imnotjames
Copy link
Contributor

Duplicate of #2990

@imnotjames imnotjames marked this as a duplicate of #2990 Oct 7, 2020
@wanghq
Copy link

wanghq commented Jun 21, 2022

Seems this problem still exists. Can anyone confirm?

@ashrafatef
Copy link

any updates because it still exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants