OFDL: 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 60e74a130d
commit 28388257f8

View File

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