diff --git a/BTCPayServer/Authentication/TokenRepository.cs b/BTCPayServer/Authentication/TokenRepository.cs index 776533fe3..c1f3b5e12 100644 --- a/BTCPayServer/Authentication/TokenRepository.cs +++ b/BTCPayServer/Authentication/TokenRepository.cs @@ -242,6 +242,8 @@ namespace BTCPayServer.Authentication using (var ctx = _Factory.CreateContext()) { var token = await ctx.PairedSINData.FindAsync(tokenId); + if (token == null) + return null; return CreateTokenEntity(token); } }