From 57beee6c6964e930076de9d637d50098238c74c4 Mon Sep 17 00:00:00 2001 From: alecmerdler Date: Fri, 31 Mar 2017 13:53:42 -0700 Subject: [PATCH] handle undefined case in BuildService#getBuildMessage --- static/js/services/build/build.service.impl.spec.ts | 3 ++- static/js/services/build/build.service.impl.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/static/js/services/build/build.service.impl.spec.ts b/static/js/services/build/build.service.impl.spec.ts index 7fd08cd2d..a2e748206 100644 --- a/static/js/services/build/build.service.impl.spec.ts +++ b/static/js/services/build/build.service.impl.spec.ts @@ -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'}, diff --git a/static/js/services/build/build.service.impl.ts b/static/js/services/build/build.service.impl.ts index a65fb6a56..53cca4901 100644 --- a/static/js/services/build/build.service.impl.ts +++ b/static/js/services/build/build.service.impl.ts @@ -15,6 +15,7 @@ export class BuildServiceImpl implements BuildService { var message: string; switch (phase) { case null: + case undefined: message = ''; break;