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

fix: Don't crash if disabled user is missing in the database #48207

Conversation

artonge
Copy link
Contributor

@artonge artonge commented Sep 19, 2024

If the user is missing in the DB, then getEMailAddress will throw as user will be null.

@artonge artonge self-assigned this Sep 19, 2024
@artonge artonge added bug 3. to review Waiting for reviews feature: users and groups php Pull requests that update Php code labels Sep 19, 2024
@artonge artonge added this to the Nextcloud 31 milestone Sep 19, 2024
@artonge
Copy link
Contributor Author

artonge commented Sep 19, 2024

/backport to stable30

@artonge
Copy link
Contributor Author

artonge commented Sep 19, 2024

/backport to stable29

@artonge
Copy link
Contributor Author

artonge commented Sep 19, 2024

/backport to stable28

Copy link
Contributor

@come-nc come-nc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, please throw a NoUserException and catch that, using try/catch for a typeerror is a bad idea.

@artonge artonge force-pushed the artonge/fix/prevent_missing_users_from_crashing_disabled_users_search branch from eaaad6a to 5a951fa Compare September 19, 2024 13:55
@artonge artonge force-pushed the artonge/fix/prevent_missing_users_from_crashing_disabled_users_search branch 2 times, most recently from 88a9483 to 1fa3842 Compare September 20, 2024 09:11
@artonge artonge force-pushed the artonge/fix/prevent_missing_users_from_crashing_disabled_users_search branch from cfb20c0 to e0ed466 Compare September 20, 2024 09:26
@artonge artonge force-pushed the artonge/fix/prevent_missing_users_from_crashing_disabled_users_search branch 7 times, most recently from c99c43a to 78bfecb Compare September 20, 2024 14:48
Signed-off-by: Louis Chemineau <louis@chmn.me>
@artonge artonge force-pushed the artonge/fix/prevent_missing_users_from_crashing_disabled_users_search branch from 78bfecb to 22d5d29 Compare September 23, 2024 08:40
@artonge artonge merged commit 0dc2363 into master Sep 23, 2024
173 checks passed
@artonge artonge deleted the artonge/fix/prevent_missing_users_from_crashing_disabled_users_search branch September 23, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug feature: users and groups php Pull requests that update Php code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants