mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-21 22:11:48 +01:00
try fix migration for pos yml
This commit is contained in:
parent
73fbfbd7cb
commit
3703a170e7
1 changed files with 5 additions and 1 deletions
|
@ -341,9 +341,13 @@ namespace BTCPayServer.Hosting
|
|||
{
|
||||
var items = new List<ViewPointOfSaleViewModel.Item>();
|
||||
var stream = new YamlStream();
|
||||
if (string.IsNullOrEmpty(yaml))
|
||||
return items.ToArray();
|
||||
|
||||
stream.Load(new StringReader(yaml));
|
||||
|
||||
var root = stream.Documents.First().RootNode as YamlMappingNode;
|
||||
if(stream.Documents.FirstOrDefault()?.RootNode is not YamlMappingNode root)
|
||||
return items.ToArray();
|
||||
foreach (var posItem in root.Children)
|
||||
{
|
||||
var trimmedKey = ((YamlScalarNode)posItem.Key).Value?.Trim();
|
||||
|
|
Loading…
Add table
Reference in a new issue