forked from sim0n00ps/OF-DL
OFDL: Fixed bug in GetNestedPropertyValue
Caused by DTO mapper not mapping "Full" model when Url was null or empty.
This commit is contained in:
parent
60e74a130d
commit
28388257f8
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user