From d0d44605a9dcbd97f5442742f16f56341f27184a Mon Sep 17 00:00:00 2001 From: Sida Chen Date: Mon, 22 Oct 2018 23:50:40 -0400 Subject: [PATCH] Fix null path exception when checking path tsc compiles default parameter to have `path === void 0`, which doesn't catch the case of path is null. --- .../dockerfile-path-select/dockerfile-path-select.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/directives/ui/dockerfile-path-select/dockerfile-path-select.component.ts b/static/js/directives/ui/dockerfile-path-select/dockerfile-path-select.component.ts index fe63e66b3..82e17faf1 100644 --- a/static/js/directives/ui/dockerfile-path-select/dockerfile-path-select.component.ts +++ b/static/js/directives/ui/dockerfile-path-select/dockerfile-path-select.component.ts @@ -42,7 +42,7 @@ export class DockerfilePathSelectComponent implements OnChanges { this.isUnknownPath = false; var isValidPath: boolean = false; - if (path.length > 0 && path[0] === '/') { + if (path != null && path.length > 0 && path[0] === '/') { isValidPath = true; this.isUnknownPath = supportsFullListing && paths.indexOf(path) < 0; }