|
@@ -92,13 +92,12 @@ namespace InABox.Core
|
|
|
|
|
|
public static bool Find(ISubObject subObject, string name, [NotNullWhen(true)] out ILinkedProperty? property, out BaseObject parent)
|
|
public static bool Find(ISubObject subObject, string name, [NotNullWhen(true)] out ILinkedProperty? property, out BaseObject parent)
|
|
{
|
|
{
|
|
|
|
+ property = null;
|
|
parent = GetParent(subObject);
|
|
parent = GetParent(subObject);
|
|
|
|
+ if (parent == null)
|
|
|
|
+ return false;
|
|
if(!_LinkedProperties.TryGetValue(parent.GetType(), out var props))
|
|
if(!_LinkedProperties.TryGetValue(parent.GetType(), out var props))
|
|
- {
|
|
|
|
- property = null;
|
|
|
|
return false;
|
|
return false;
|
|
- }
|
|
|
|
-
|
|
|
|
var path = GetPath(subObject);
|
|
var path = GetPath(subObject);
|
|
property = props.FirstOrDefault(x => x.Path == path && x.Source == name);
|
|
property = props.FirstOrDefault(x => x.Path == path && x.Source == name);
|
|
return property != null;
|
|
return property != null;
|