Skip to content

Commit

Permalink
fix: 修复DataPropertyObject错误设置值的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuYunPlayer committed Nov 27, 2024
1 parent c824d8e commit 5c6fa00
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions TuneLab.Base/Properties/DataPropertyObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,19 @@ public PropertyValue GetValue(PropertyPath.Key key)

public DataPropertyValue SetValue(PropertyPath.Key key, PropertyValue value)
{
var dataPropertyValue = FindValue(key);
var propertyValue = dataPropertyValue.Value;
if (key.IsObject && propertyValue.ToObject(out var propertyObject))
var dataPropertyValue = FindValue(key);
if (key.IsObject)
{
var propertyValue = dataPropertyValue.Value;
if (!propertyValue.ToObject(out var propertyObject))
{
propertyObject = new(new DataPropertyObject());
dataPropertyValue.Set(propertyObject);
}

var dataPropertyObject = (DataPropertyObject)propertyObject.Map;
dataPropertyObject.SetValue(key.Next, value);

}
else
{
Expand Down

0 comments on commit 5c6fa00

Please sign in to comment.