Skip to content

Commit 7fdfdd1

Browse files
fix error on getting properties of abstract TextValue
1 parent 71bea14 commit 7fdfdd1

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

Code/ValueSystem/Value.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,18 @@ string s
7979

8080
public static Dictionary<string, IValueWithProperties.PropInfo>? GetPropertiesOfValue(Type t)
8181
{
82-
if (typeof(ReferenceValue).IsAssignableFrom(t) && t.IsGenericType)
82+
if (!typeof(IValueWithProperties).IsAssignableFrom(t)) return null;
83+
84+
if (t == typeof(TextValue))
85+
{
86+
t = typeof(StaticTextValue);
87+
}
88+
else if (typeof(ReferenceValue).IsAssignableFrom(t) && t.IsGenericType)
8389
{
8490
return ReferencePropertyRegistry.GetProperties(t.GetGenericArguments()[0]);
8591
}
86-
87-
if (!typeof(IValueWithProperties).IsAssignableFrom(t)) return null;
88-
return ((IValueWithProperties)t.CreateInstance<Value>()).Properties;
92+
93+
return t.CreateInstance<IValueWithProperties>().Properties;
8994
}
9095

9196
public string FriendlyName => GetFriendlyName(GetType());

0 commit comments

Comments
 (0)