From 93645b2fbeaa6f4664cb2ce3d3ee792d7406a782 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Fri, 7 Dec 2018 13:48:39 +0900 Subject: [PATCH] Fix error 500 if token not found --- BTCPayServer/Authentication/TokenRepository.cs | 2 ++ 1 file changed, 2 insertions(+) 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); } }