Skip to content

Commit 35edf0b

Browse files
committed
Make sure _id is kept for zero code tool while avoiding warning message in BHoM UI
1 parent ed7fd19 commit 35edf0b

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

SQL_Engine/Convert/FromDictionary.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,14 @@ public static object FromDictionary(this Dictionary<string, object> dic, Type ty
5050
{
5151
try
5252
{
53-
if (instance is BHoMObject && !kvp.Key.StartsWith("_") && kvp.Value != null && !(kvp.Value is DBNull))
54-
instance.SetPropertyValue(kvp.Key, kvp.Value);
53+
if (kvp.Value != null && !(kvp.Value is DBNull))
54+
{
55+
if (kvp.Key.StartsWith("_") && instance is BHoMObject)
56+
((BHoMObject)instance).CustomData[kvp.Key] = kvp.Value;
57+
else
58+
instance.SetPropertyValue(kvp.Key, kvp.Value);
59+
}
60+
5561
}
5662
catch { }
5763
}

0 commit comments

Comments
 (0)