Skip to content

Commit

Permalink
beware of keybinding command null arguments
Browse files Browse the repository at this point in the history
fixes #50821
  • Loading branch information
joaomoreno committed Jun 1, 2018
1 parent 1810448 commit 30317e9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions extensions/git/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,8 @@ export class CommandCenter {

@command('git.stage')
async stage(...resourceStates: SourceControlResourceState[]): Promise<void> {
resourceStates = resourceStates.filter(s => !!s);

if (resourceStates.length === 0 || (resourceStates[0] && !(resourceStates[0].resourceUri instanceof Uri))) {
const resource = this.getSCMResource();

Expand Down Expand Up @@ -786,6 +788,8 @@ export class CommandCenter {

@command('git.unstage')
async unstage(...resourceStates: SourceControlResourceState[]): Promise<void> {
resourceStates = resourceStates.filter(s => !!s);

if (resourceStates.length === 0 || (resourceStates[0] && !(resourceStates[0].resourceUri instanceof Uri))) {
const resource = this.getSCMResource();

Expand Down Expand Up @@ -852,6 +856,8 @@ export class CommandCenter {

@command('git.clean')
async clean(...resourceStates: SourceControlResourceState[]): Promise<void> {
resourceStates = resourceStates.filter(s => !!s);

if (resourceStates.length === 0 || (resourceStates[0] && !(resourceStates[0].resourceUri instanceof Uri))) {
const resource = this.getSCMResource();

Expand Down Expand Up @@ -1522,6 +1528,8 @@ export class CommandCenter {

@command('git.ignore')
async ignore(...resourceStates: SourceControlResourceState[]): Promise<void> {
resourceStates = resourceStates.filter(s => !!s);

if (resourceStates.length === 0 || (resourceStates[0] && !(resourceStates[0].resourceUri instanceof Uri))) {
const resource = this.getSCMResource();

Expand Down

0 comments on commit 30317e9

Please sign in to comment.