Commit 03c5dbd
committed
fix(git): guard CommandManager.get(...).setChecked against early panel events
WorkspaceManager.EVENT_WORKSPACE_PANEL_SHOWN/HIDDEN can fire during
project-open before the Git extension's init flow has registered
CMD_GIT_TOGGLE_PANEL. CommandManager.get(...) then returns undefined
and the .setChecked(...) call throws TypeError, which surfaced as
"Exception in 'panelShown' listener" in the Git main.js stack.
Wrap the lookup + setChecked in a small _setTogglePanelChecked helper
that no-ops when the command isn't registered yet — init will sync
the checked state on its own once it runs. Apply at the three call
sites (panel-shown listener, panel-hidden listener, and toggle()).1 parent 2399011 commit 03c5dbd
1 file changed
Lines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
931 | 931 | | |
932 | 932 | | |
933 | 933 | | |
934 | | - | |
| 934 | + | |
935 | 935 | | |
936 | 936 | | |
937 | 937 | | |
| |||
1510 | 1510 | | |
1511 | 1511 | | |
1512 | 1512 | | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
1513 | 1525 | | |
1514 | 1526 | | |
1515 | 1527 | | |
1516 | 1528 | | |
1517 | 1529 | | |
1518 | 1530 | | |
1519 | | - | |
| 1531 | + | |
1520 | 1532 | | |
1521 | 1533 | | |
1522 | 1534 | | |
1523 | 1535 | | |
1524 | 1536 | | |
1525 | 1537 | | |
1526 | 1538 | | |
1527 | | - | |
| 1539 | + | |
1528 | 1540 | | |
1529 | 1541 | | |
1530 | 1542 | | |
| |||
1535 | 1547 | | |
1536 | 1548 | | |
1537 | 1549 | | |
1538 | | - | |
| 1550 | + | |
1539 | 1551 | | |
1540 | 1552 | | |
1541 | 1553 | | |
| |||
0 commit comments