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); + } } }