From e670ad5701ba4e6fbfa2a9e087e818541e44c815 Mon Sep 17 00:00:00 2001 From: Mario Steele Date: Thu, 24 Jul 2025 04:21:10 -0500 Subject: [PATCH] Updated MapData Had data going in the wrong direction, corrected this. --- FreeTubeSync/Database/MapData.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/FreeTubeSync/Database/MapData.cs b/FreeTubeSync/Database/MapData.cs index f6dc079..ef8b010 100644 --- a/FreeTubeSync/Database/MapData.cs +++ b/FreeTubeSync/Database/MapData.cs @@ -4,7 +4,7 @@ namespace FreeTubeSync.Database; public static class MapData { - public static void MapFrom(this object obj1, object obj2) + public static void MapFrom(this object obj2, object obj1) { var props = new Dictionary(); var t1Type = obj1.GetType(); @@ -18,8 +18,12 @@ public static class MapData properties = t2Type.GetProperties(); foreach (var property in properties) { - if (props[property.Name] is not IEnumerable) - property.SetValue(obj2, props[property.Name]); + if (props.ContainsKey(property.Name)) + { + var value = props[property.Name]; + if (value is string || value is not IEnumerable) + property.SetValue(obj2, value); + } } }