Handle malformed proxy tag importing correctly
This commit is contained in:
parent
026932049a
commit
7bdc3020b0
@ -162,7 +162,8 @@ namespace PluralKit.Bot
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
member.ProxyTags = dataMember.ProxyTags ?? new ProxyTag[] { };
|
// Ignore proxy tags where both prefix and suffix are set to null (would be invalid anyway)
|
||||||
|
member.ProxyTags = (dataMember.ProxyTags ?? new ProxyTag[] { }).Where(tag => !tag.IsEmpty).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
member.KeepProxy = dataMember.KeepProxy;
|
member.KeepProxy = dataMember.KeepProxy;
|
||||||
|
@ -51,6 +51,8 @@ namespace PluralKit
|
|||||||
|
|
||||||
[JsonIgnore] public string ProxyString => $"{Prefix ?? ""}text{Suffix ?? ""}";
|
[JsonIgnore] public string ProxyString => $"{Prefix ?? ""}text{Suffix ?? ""}";
|
||||||
|
|
||||||
|
public bool IsEmpty => Prefix == null && Suffix == null;
|
||||||
|
|
||||||
public bool Equals(ProxyTag other) => Prefix == other.Prefix && Suffix == other.Suffix;
|
public bool Equals(ProxyTag other) => Prefix == other.Prefix && Suffix == other.Suffix;
|
||||||
|
|
||||||
public override bool Equals(object obj) => obj is ProxyTag other && Equals(other);
|
public override bool Equals(object obj) => obj is ProxyTag other && Equals(other);
|
||||||
|
Loading…
Reference in New Issue
Block a user