Merge pull request #2501 from alecmerdler/fix-buildservice

Handle undefined case in BuildService#getBuildMessage
This commit is contained in:
Alec Merdler 2017-03-31 13:56:15 -07:00 committed by GitHub
commit df235d9315
2 changed files with 3 additions and 1 deletions

View file

@ -33,10 +33,11 @@ describe("BuildServiceImpl", () => {
});
describe("getBuildMessage", () => {
var buildMessages: {phase: string, message: string}[];
var buildMessages: {phase?: string, message: string}[];
beforeEach(() => {
buildMessages = [
{message: ""},
{phase: null, message: ""},
{phase: 'cannot_load', message: 'Cannot load build status'},
{phase: 'starting', message: 'Starting Dockerfile build'},

View file

@ -15,6 +15,7 @@ export class BuildServiceImpl implements BuildService {
var message: string;
switch (phase) {
case null:
case undefined:
message = '';
break;