Skip to content

Commit

Permalink
Fixed an error when parsing custom layout data if the xml-element con…
Browse files Browse the repository at this point in the history
…tains an attribute
  • Loading branch information
DarthAffe committed Oct 31, 2023
1 parent 883d6cb commit 188de3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion RGB.NET.Layout/DeviceLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public class DeviceLayout : IDeviceLayout
/// <returns>The deserialized custom data object.</returns>
protected virtual object? GetCustomData(object? customData, Type? type)
{
XmlNode? node = (customData as XmlNode) ?? (customData as IEnumerable<XmlNode>)?.FirstOrDefault()?.ParentNode; //HACK DarthAffe 16.01.2021: This gives us the CustomData-Node
XmlNode? node = (customData as XmlNode) ?? (customData as IEnumerable<XmlNode>)?.FirstOrDefault(x => x.ParentNode != null)?.ParentNode; //HACK DarthAffe 16.01.2021: This gives us the CustomData-Node
if ((node == null) || (type == null)) return null;

using MemoryStream ms = new();
Expand Down

0 comments on commit 188de3c

Please sign in to comment.