Skip to content

Commit

Permalink
npe in scm world
Browse files Browse the repository at this point in the history
fixes #37221
  • Loading branch information
joaomoreno committed Nov 1, 2017
1 parent 93338c6 commit cadcedc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/vs/workbench/api/electron-browser/mainThreadSCM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,9 @@ class MainThreadSCMProvider implements ISCMProvider {
tooltip,
strikeThrough,
faded,

source,
letter,
color: color.id
color: color && color.id
};

return new MainThreadSCMResource(
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/api/node/extHost.protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,9 @@ export type SCMRawResource = [
boolean /*strike through*/,
boolean /*faded*/,

string /*source*/,
string /*letter*/,
ThemeColor /*color*/
string | undefined /*source*/,
string | undefined /*letter*/,
ThemeColor | null /*color*/
];

export type SCMRawResourceSplice = [
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/api/node/extHostSCM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ class ExtHostSourceControlResourceGroup implements vscode.SourceControlResourceG
const strikeThrough = r.decorations && !!r.decorations.strikeThrough;
const faded = r.decorations && !!r.decorations.faded;

const source = r.decorations && r.decorations.source;
const letter = r.decorations && r.decorations.letter;
const color = r.decorations && r.decorations.color;
const source = r.decorations && r.decorations.source || undefined;
const letter = r.decorations && r.decorations.letter || undefined;
const color = r.decorations && r.decorations.color || undefined;

return [handle, sourceUri, icons, tooltip, strikeThrough, faded, source, letter, color] as SCMRawResource;
});
Expand Down

0 comments on commit cadcedc

Please sign in to comment.