Fixed bug in GetNestedPropertyValue

Caused by DTO mapper not mapping "Full" model when Url was null or empty.
This commit is contained in:
Casper Sparre 2026-02-19 22:42:27 +01:00
parent e8a763a654
commit bae0166925

View File

@ -200,9 +200,11 @@ public class FileNameService(IAuthService authService) : IFileNameService
object? value = source;
foreach (string propertyName in propertyPath.Split('.'))
{
PropertyInfo property = value?.GetType().GetProperty(propertyName) ??
throw new ArgumentException($"Property '{propertyName}' not found.");
value = property.GetValue(value);
PropertyInfo? property = value?.GetType().GetProperty(propertyName);
value = property?.GetValue(value);
if (value is null)
break;
}
return value;