mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
try fix migration for pos yml
This commit is contained in:
@@ -341,9 +341,13 @@ namespace BTCPayServer.Hosting
|
|||||||
{
|
{
|
||||||
var items = new List<ViewPointOfSaleViewModel.Item>();
|
var items = new List<ViewPointOfSaleViewModel.Item>();
|
||||||
var stream = new YamlStream();
|
var stream = new YamlStream();
|
||||||
|
if (string.IsNullOrEmpty(yaml))
|
||||||
|
return items.ToArray();
|
||||||
|
|
||||||
stream.Load(new StringReader(yaml));
|
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)
|
foreach (var posItem in root.Children)
|
||||||
{
|
{
|
||||||
var trimmedKey = ((YamlScalarNode)posItem.Key).Value?.Trim();
|
var trimmedKey = ((YamlScalarNode)posItem.Key).Value?.Trim();
|
||||||
|
|||||||
Reference in New Issue
Block a user