diff --git a/src/apps.js b/src/apps.js index 271d4c2ea..e21d58e73 100644 --- a/src/apps.js +++ b/src/apps.js @@ -554,7 +554,7 @@ function getDuplicateErrorDetails(errorMessage, locations, portBindings) { if (match[2] === 'locations.subdomain') { for (let i = 0; i < locations.length; i++) { const { subdomain, domain, type } = locations[i]; - if (match[1] !== `${subdomain}-${domain}`) continue; + if (match[1] !== (subdomain ? `${subdomain}-${domain}` : domain)) continue; return new BoxError(BoxError.ALREADY_EXISTS, `${type} location '${dns.fqdn(subdomain, domain)}' is in use`); }