diff --git a/static/js/controllers.js b/static/js/controllers.js index d63586c27..bc802931e 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -825,8 +825,8 @@ function BuildPackageCtrl($scope, Restangular, ApiService, $routeParams, $rootSc if (dockerfileFolder[0] == '/') { dockerfileFolder = dockerfileFolder.substr(1); } - if (dockerfileFolder[dockerfileFolder.length - 1] == '/') { - dockerfileFolder = dockerfileFolder.substr(0, dockerfileFolder.length - 1); + if (dockerfileFolder && dockerFileFolder[dockerFileFolder.length - 1] != '/') { + dockerfileFolder += '/'; } dockerfilePath = dockerfileFolder + 'Dockerfile'; diff --git a/static/partials/build-package.html b/static/partials/build-package.html index 5ca4dfd13..7bd6529ea 100644 --- a/static/partials/build-package.html +++ b/static/partials/build-package.html @@ -37,9 +37,9 @@
-
{{ dockerFilePath }}
-
- No Dockerfile found in the build pack +
{{ dockerFilePath }}
+
+ No Dockerfile found in the build pack