Skip to content

Commit 395da8e

Browse files
committed
Fixes #252 - Cannot read property 'push' of undefined
1 parent 68ec6e6 commit 395da8e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1010
- Also remaps `Show SCM` to `Ctrl+Shift+G G` since by default it is `Ctrl+Shift+G` if the `chorded` keymap is used
1111

1212
### Fixed
13+
- Fixes [#252](https://github.com/eamodio/vscode-gitlens/issues/252) - Cannot read property 'push' of undefined
1314
- Fixes issue where GitLens wouldn't detect the creation of a Git repository if there were no other repositories open
1415
- Fixes issue where some GitLens commands would show in the palette even though there was no repository
1516

src/views/statusNode.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ export class StatusNode extends ExplorerNode {
2020
async getChildren(): Promise<ExplorerNode[]> {
2121
this.resetChildren();
2222

23-
this.children = [];
24-
2523
const status = await this.repo.getStatus();
26-
if (status === undefined) return this.children;
24+
if (status === undefined) return [];
25+
26+
this.children = [];
2727

2828
if (status.state.behind) {
2929
this.children.push(new StatusUpstreamNode(status, 'behind', this.explorer));

0 commit comments

Comments
 (0)