fix(apiv2): don't ISE on invalid entity references
This commit is contained in:
parent
0aefafb62d
commit
2d72fd6aa1
@ -49,7 +49,7 @@ namespace PluralKit.API
|
|||||||
if (_shortIdRegex.IsMatch(systemRef))
|
if (_shortIdRegex.IsMatch(systemRef))
|
||||||
return _repo.GetSystemByHid(systemRef);
|
return _repo.GetSystemByHid(systemRef);
|
||||||
|
|
||||||
return null;
|
return Task.FromResult<PKSystem?>(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Task<PKMember?> ResolveMember(string memberRef)
|
protected Task<PKMember?> ResolveMember(string memberRef)
|
||||||
@ -60,7 +60,7 @@ namespace PluralKit.API
|
|||||||
if (_shortIdRegex.IsMatch(memberRef))
|
if (_shortIdRegex.IsMatch(memberRef))
|
||||||
return _repo.GetMemberByHid(memberRef);
|
return _repo.GetMemberByHid(memberRef);
|
||||||
|
|
||||||
return null;
|
return Task.FromResult<PKMember?>(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Task<PKGroup?> ResolveGroup(string groupRef)
|
protected Task<PKGroup?> ResolveGroup(string groupRef)
|
||||||
@ -71,7 +71,7 @@ namespace PluralKit.API
|
|||||||
if (_shortIdRegex.IsMatch(groupRef))
|
if (_shortIdRegex.IsMatch(groupRef))
|
||||||
return _repo.GetGroupByHid(groupRef);
|
return _repo.GetGroupByHid(groupRef);
|
||||||
|
|
||||||
return null;
|
return Task.FromResult<PKGroup?>(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LookupContext ContextFor(PKSystem system)
|
public LookupContext ContextFor(PKSystem system)
|
||||||
|
Loading…
Reference in New Issue
Block a user