Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

When switching accounts, getCurrentUser() can return undefined during the transition, causing "Cannot read properties of undefined (reading 'login')" when accessing currentUser.login or pullRequest.author.login.

Changes

  • Add null guard for currentUser after async resolution
  • Add null guard for pullRequest.author before property access
if (!currentUser) {
    throw new Error('Unable to get current user');
}

if (!pullRequest.author) {
    throw new Error('Pull request author is missing');
}

Follows the existing pattern used for the !pullRequest check. Provides clearer error messages instead of the cryptic property access error.

Original prompt

This section details on the original issue you should resolve

<issue_title>Error updating active pull request view: Cannot read properties of undefined (reading 'login')</issue_title>
<issue_description>1. Log out from your corp account
2. Login with your free account
3. Sometimes I see the Error updating active pull request view: Cannot read properties of undefined (reading 'login')

Image</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 2, 2026 11:28
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
…rror

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error updating active pull request view Fix undefined login error when updating active pull request view Feb 2, 2026
Copilot AI requested a review from alexr00 February 2, 2026 11:32
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.

Error updating active pull request view: Cannot read properties of undefined (reading 'login')

2 participants