Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 19, 2025

The invite validation logic checked invitingProfile for null after using invitingProfileId in subsequent validations, creating a potential null reference path if itemsApi.getItem() returned null.

Changes

  • Moved invitingProfile null check immediately after fetch, before self-invite and already-following checks

Before

const invitingProfile = await itemsApi.getItem(invitingProfileId)

if (invitingProfileId === myProfile?.id) { ... }  // Uses invitingProfileId
if (myProfile?.relations?.some(...)) { ... }      // Uses invitingProfileId
if (!invitingProfile) { ... }                     // Null check comes last

After

const invitingProfile = await itemsApi.getItem(invitingProfileId)

if (!invitingProfile) { ... }                     // Null check first
if (invitingProfileId === myProfile?.id) { ... }
if (myProfile?.relations?.some(...)) { ... }

This ensures the profile exists before downstream validation logic executes.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: antontranelis <31516529+antontranelis@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 19, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • download.cypress.io
    • Triggering command: /usr/local/bin/node node dist/index.js --exec install (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Update redeem flow and invite page based on feedback Fix null check ordering in invite validation flow Dec 19, 2025
Copilot AI requested a review from antontranelis December 19, 2025 06:14
@antontranelis antontranelis changed the title Fix null check ordering in invite validation flow fix(lib): null check ordering in invite validation flow Dec 19, 2025
@antontranelis antontranelis marked this pull request as ready for review December 19, 2025 06:49
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