Skip to content

fix: NullReferenceException when non-member joins channel via SignalR#1530

Open
kuu-26 wants to merge 1 commit intoValour-Software:mainfrom
kuu-26:fix/nullref-join-channel
Open

fix: NullReferenceException when non-member joins channel via SignalR#1530
kuu-26 wants to merge 1 commit intoValour-Software:mainfrom
kuu-26:fix/nullref-join-channel

Conversation

@kuu-26
Copy link
Copy Markdown
Contributor

@kuu-26 kuu-26 commented Apr 18, 2026

The JoinChannel hub method was calling .ToModel() on a potentially null PlanetMember result from FirstOrDefaultAsync(). When a user who is not a member of the planet tries to join a channel, this caused a NullReferenceException that propagated all the way through PlanetPermissionService.GetChannelPermissionsAsync.

Fix: Check for null dbMember before calling .ToModel() and return an appropriate error message.

Fixes VALOUR-BACKEND-2W (254 events, 30 users affected)

The JoinChannel hub method was calling .ToModel() on a potentially null
PlanetMember result from FirstOrDefaultAsync(). When a user who is not
a member of the planet tries to join a channel, this caused a
NullReferenceException that propagated all the way through
PlanetPermissionService.GetChannelPermissionsAsync.

Fix: Check for null dbMember before calling .ToModel() and return an
appropriate error message.

Fixes VALOUR-BACKEND-2W (254 events, 30 users affected)
@kuu-26 kuu-26 requested a review from a team as a code owner April 18, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants