Skip to content

Commit a6b7a7d

Browse files
committed
Only clean domain names on cert save if given
1 parent dc2c05a commit a6b7a7d

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

backend/models/certificate.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ class Certificate extends Model {
3636
}
3737

3838
// Default for domain_names
39-
this.domain_names = cleanDomainNames(this.domain_names);
39+
if (typeof this.domain_names !== "undefined") {
40+
this.domain_names = cleanDomainNames(this.domain_names);
41+
}
4042

4143
// Default for meta
4244
if (typeof this.meta === "undefined") {
@@ -46,7 +48,9 @@ class Certificate extends Model {
4648

4749
$beforeUpdate() {
4850
this.modified_on = now();
49-
this.domain_names = cleanDomainNames(this.domain_names);
51+
if (typeof this.domain_names !== "undefined") {
52+
this.domain_names = cleanDomainNames(this.domain_names);
53+
}
5054
}
5155

5256
$parseDatabaseJson(json) {

0 commit comments

Comments
 (0)