rkotze / git-mob-vs-code

Co-author commits. A quick way to add co-author metadata to a Git commit via VS Code source control panel.
https://marketplace.visualstudio.com/items?itemName=RichardKotze.git-mob
MIT License
34 stars 9 forks source link

Cannot read properties of undefined (reading 'email') #344

Closed Zaczero closed 2 months ago

Zaczero commented 2 months ago

Prerequisites

Description

On VSCode startup, I receive the "Cannot read properties of undefined (reading 'email')" error. The extension used to work just fine but suddenly stopped one day.

image

Steps to Reproduce

  1. Start VSCode

Expected behaviour: Works

Actual behaviour: Doesn't work

Reproduces how often: 100%

Versions

Additional Information

image

[Extension Host] SETUP ERROR:  TypeError: Cannot read properties of undefined (reading 'email')
    at /home/user/.vscode/extensions/richardkotze.git-mob-1.20.1/src/build-co-author-groups.js:26:48
    at Array.filter (<anonymous>)
    at resolveAuthorLists (/home/user/.vscode/extensions/richardkotze.git-mob-1.20.1/src/build-co-author-groups.js:26:18)
    at buildCoAuthorGroups (/home/user/.vscode/extensions/richardkotze.git-mob-1.20.1/src/build-co-author-groups.js:41:3)
    at bootGitMob (/home/user/.vscode/extensions/richardkotze.git-mob-1.20.1/src/setup-git-mob.js:41:51)
Zaczero commented 2 months ago

Turns out my git configuration was messed up. Perhaps the error message could be slightly more intuitive? Otherwise, feel free to close the issue :+1:.

rkotze commented 2 months ago

Hi @Zaczero

Glad you fixed the issue.

Improving the error message does sound useful but it will be a while before I get to look at it. You are welcome to contribute to add better error handling?