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
c6793f6834
commit
6cc09a2b0f
@ -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;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user