Missing null check on client properties after FirstOrDefaultAsync in ClientNotificationsService

Open Beginner friendly
#83 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
70/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
csharp
Domain
backend

Research direction

Open Appy/Services/ClientNotificationsService.cs around line 85 and trace the FirstOrDefaultAsync result through later accesses to client. Confirm how the service handles a missing client, then ensure every downstream Contacts access is covered by the intended null-safe behavior. Done means the missing-client path returns a clean error instead of a NullReferenceException.

Written by the indexing model from the issue text.

Description

bug llm generated medium priority

Description

After fetching a client with FirstOrDefaultAsync, the code checks if (client == null) early, but later accesses client.Contacts without a null-coalescing guard, assuming the client is still valid.

Location

  • Appy/Services/ClientNotificationsService.cs (line ~85)

Risk

If the client is deleted between the null check and the property access (e.g. concurrent request), the code throws a NullReferenceException rather than returning a clean error.

Suggested Fix

Ensure the null check covers all downstream property accesses, or fetch the full object with required navigations in a single query with appropriate includes.

Dominant language
TypeScript
Stars
1
Forks
1
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Worly/Appy

All issues in Worly/Appy

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.