Avoid adding empty entries to the donain list, when nothing is chosen.

Co-authored-by: Nikita Karamov <nick@karamoff.dev>
This commit is contained in:
Andy Balaam 2020-09-24 10:59:25 +01:00 committed by GitHub
parent d4bf9e6456
commit 3cc3c96a3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,7 +40,7 @@ function instances_loaded() {
const chosen_instance = instance.value;
const domains = servers.map(obj => obj.domain);
if (domains.indexOf(chosen_instance) === -1) {
if (chosen_instance && domains.indexOf(chosen_instance) === -1) {
domains.push(chosen_instance);
}
domains.sort();