From 2d72fd6aa12473c6985a3207c18ca80596f5824f Mon Sep 17 00:00:00 2001 From: spiral Date: Tue, 12 Oct 2021 08:10:20 -0400 Subject: [PATCH] fix(apiv2): don't ISE on invalid entity references --- PluralKit.API/Controllers/PKControllerBase.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PluralKit.API/Controllers/PKControllerBase.cs b/PluralKit.API/Controllers/PKControllerBase.cs index cd3db2f5..50172df7 100644 --- a/PluralKit.API/Controllers/PKControllerBase.cs +++ b/PluralKit.API/Controllers/PKControllerBase.cs @@ -49,7 +49,7 @@ namespace PluralKit.API if (_shortIdRegex.IsMatch(systemRef)) return _repo.GetSystemByHid(systemRef); - return null; + return Task.FromResult(null); } protected Task ResolveMember(string memberRef) @@ -60,7 +60,7 @@ namespace PluralKit.API if (_shortIdRegex.IsMatch(memberRef)) return _repo.GetMemberByHid(memberRef); - return null; + return Task.FromResult(null); } protected Task ResolveGroup(string groupRef) @@ -71,7 +71,7 @@ namespace PluralKit.API if (_shortIdRegex.IsMatch(groupRef)) return _repo.GetGroupByHid(groupRef); - return null; + return Task.FromResult(null); } public LookupContext ContextFor(PKSystem system)