Skip to content

fix(LoginController): guard dispatch against null user#1367

Merged
julien-nc merged 1 commit intomainfrom
fixUserNullError
Mar 10, 2026
Merged

fix(LoginController): guard dispatch against null user#1367
julien-nc merged 1 commit intomainfrom
fixUserNullError

Conversation

@solracsf
Copy link
Member

@solracsf solracsf commented Mar 10, 2026

The event dispatch was called unconditionally, assuming a new user had just been created, causing a fatal TypeError:

OCP\User\Events\UserCreatedEvent::__construct(): Argument #1 ($user) must be of type OCP\IUser, null given

Regression from #1353

($user will always be null if 'disable_account_creation' => true,)

@solracsf solracsf requested a review from julien-nc March 10, 2026 08:49
@solracsf solracsf added the bug Something isn't working label Mar 10, 2026
@solracsf solracsf force-pushed the fixUserNullError branch 3 times, most recently from bec8dc3 to 6f08019 Compare March 10, 2026 09:30
Copy link
Member

@julien-nc julien-nc left a comment

Choose a reason for hiding this comment

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

Thank you for the fix!

Could you list exactly all the changes you made in the PR comment?
It would be helpful to have a few comments in the code as well.

@solracsf
Copy link
Member Author

solracsf commented Mar 10, 2026

Reverted all changes beside the real fix & some code cleanup and error handling.

@solracsf solracsf requested a review from julien-nc March 10, 2026 11:01
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Copy link
Member

@julien-nc julien-nc left a comment

Choose a reason for hiding this comment

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

Thank you!

@julien-nc julien-nc merged commit 18da67f into main Mar 10, 2026
45 checks passed
@julien-nc julien-nc deleted the fixUserNullError branch March 10, 2026 11:09
@julien-nc julien-nc mentioned this pull request Mar 10, 2026
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 this pull request may close these issues.

2 participants