From a09c6d51e6c7efdd78e5cfcd5e331b4b5c36bdc3 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Mon, 25 Mar 2019 12:24:48 +0900 Subject: [PATCH] fix exception which can be thrown if the store is not found --- BTCPayServer/Security/BitpayAuthentication.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BTCPayServer/Security/BitpayAuthentication.cs b/BTCPayServer/Security/BitpayAuthentication.cs index 612937a1a..c09fd0656 100644 --- a/BTCPayServer/Security/BitpayAuthentication.cs +++ b/BTCPayServer/Security/BitpayAuthentication.cs @@ -88,7 +88,8 @@ namespace BTCPayServer.Security { claims.Add(new Claim(Policies.CanCreateInvoice.Key, storeId)); var store = await _StoreRepository.FindStore(storeId); - if (anonymous && !store.GetStoreBlob().AnyoneCanInvoice) + if (store == null || + (anonymous && !store.GetStoreBlob().AnyoneCanInvoice)) { return AuthenticateResult.Fail("Invalid credentials"); }