Probably fix roleban hwid issues (#13548)

This commit is contained in:
Kara
2023-01-17 12:10:08 -06:00
committed by GitHub
parent ab560b6976
commit f24d3208b2
2 changed files with 4 additions and 4 deletions

View File

@@ -122,7 +122,7 @@ namespace Content.Server.Database
query = query == null ? newQ : query.Union(newQ);
}
if (hwId != null)
if (hwId != null && hwId.Value.Length > 0)
{
var newQ = db.PgDbContext.Ban
.Include(p => p.Unban)
@@ -304,7 +304,7 @@ namespace Content.Server.Database
query = query == null ? newQ : query.Union(newQ);
}
if (hwId != null)
if (hwId != null && hwId.Value.Length > 0)
{
var newQ = db.PgDbContext.RoleBan
.Include(p => p.Unban)

View File

@@ -123,7 +123,7 @@ namespace Content.Server.Database
return true;
}
if (hwId is { } hwIdVar && hwIdVar.AsSpan().SequenceEqual(ban.HWId))
if (hwId is { } hwIdVar && hwIdVar.Length > 0 && hwIdVar.AsSpan().SequenceEqual(ban.HWId))
{
return true;
}
@@ -224,7 +224,7 @@ namespace Content.Server.Database
return true;
}
if (hwId is { } hwIdVar && hwIdVar.AsSpan().SequenceEqual(ban.HWId))
if (hwId is { } hwIdVar && hwIdVar.Length > 0 && hwIdVar.AsSpan().SequenceEqual(ban.HWId))
{
return true;
}