Fix potential crash on migration

This commit is contained in:
nicolas.dorier 2024-10-08 16:30:21 +09:00
parent e5bb0bcba3
commit 7c77b16517
No known key found for this signature in database
GPG key ID: 6618763EF09186FE

View file

@ -237,6 +237,8 @@ namespace BTCPayServer.Hosting
var stores = await ctx.Stores.ToArrayAsync();
foreach (var store in stores)
{
if (store.StoreBlob is null)
continue;
var blob = JObject.Parse(store.StoreBlob);
var array = blob["excludedPaymentMethods"] as JArray;
if (array is null || array.Count == 0)