handle undefined case in BuildService#getBuildMessage

This commit is contained in:
alecmerdler 2017-03-31 13:53:42 -07:00
parent 484ecd961e
commit 57beee6c69
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;