Skip to content

Commit

Permalink
Fix missing restored rules
Browse files Browse the repository at this point in the history
  • Loading branch information
mcao2 committed Jul 3, 2023
1 parent 79b42d6 commit b5f1005
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'] : "");
this.autoGeneratePattern = source['autoGeneratePattern'] == true ? true : false;
this.rulePattern = source['rulePattern'];
this.ruleRegex = source['ruleRegex'];
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit b5f1005

Please sign in to comment.