From b41619523756785d821520ce49f863af58074175 Mon Sep 17 00:00:00 2001 From: mcao2 Date: Mon, 3 Jul 2023 14:58:02 -0700 Subject: [PATCH] Fix missing restored rules --- src/core/definitions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/definitions.ts b/src/core/definitions.ts index b840273e..f5625595 100644 --- a/src/core/definitions.ts +++ b/src/core/definitions.ts @@ -737,7 +737,7 @@ export class ProxyRule implements Cloneable { this.ruleType = source['ruleType']; if (source['ruleType'] == null) this.ruleType = ProxyRuleType.DomainSubdomain; - this.hostName = source['hostName'] || source['sourceDomain']; + this.hostName = source['hostName'] !== undefined ? source['hostName'] : (source['sourceDomain'] !== undefined ? source['sourceDomain'] : null); this.autoGeneratePattern = source['autoGeneratePattern'] == true ? true : false; this.rulePattern = source['rulePattern']; this.ruleRegex = source['ruleRegex']; @@ -768,7 +768,7 @@ export class ProxyRule implements Cloneable { } public isValid(): boolean { - if (!this.rule || !this.hostName || this.ruleType == null) + if (!this.rule || this.hostName == null || this.ruleType == null) return false; return true; }