Browse Source

Fixes #252 - Cannot read property 'push' of undefined

main
Eric Amodio 7 years ago
parent
commit
395da8e3de
2 changed files with 4 additions and 3 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +3
    -3
      src/views/statusNode.ts

+ 1
- 0
CHANGELOG.md View File

@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Also remaps `Show SCM` to `Ctrl+Shift+G G` since by default it is `Ctrl+Shift+G` if the `chorded` keymap is used
### Fixed
- Fixes [#252](https://github.com/eamodio/vscode-gitlens/issues/252) - Cannot read property 'push' of undefined
- Fixes issue where GitLens wouldn't detect the creation of a Git repository if there were no other repositories open
- Fixes issue where some GitLens commands would show in the palette even though there was no repository

+ 3
- 3
src/views/statusNode.ts View File

@ -20,10 +20,10 @@ export class StatusNode extends ExplorerNode {
async getChildren(): Promise<ExplorerNode[]> {
this.resetChildren();
this.children = [];
const status = await this.repo.getStatus();
if (status === undefined) return this.children;
if (status === undefined) return [];
this.children = [];
if (status.state.behind) {
this.children.push(new StatusUpstreamNode(status, 'behind', this.explorer));

Loading…
Cancel
Save