Skip to content

Commit ed7fd19

Browse files
committed
Make sure nulls and DBNull values from the database are not set on incompatible property types
1 parent 6f11cd9 commit ed7fd19

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

SQL_Engine/Convert/FromDictionary.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static object FromDictionary(this Dictionary<string, object> dic, Type ty
5050
{
5151
try
5252
{
53-
if (instance is BHoMObject || !kvp.Key.StartsWith("_"))
53+
if (instance is BHoMObject && !kvp.Key.StartsWith("_") && kvp.Value != null && !(kvp.Value is DBNull))
5454
instance.SetPropertyValue(kvp.Key, kvp.Value);
5555
}
5656
catch { }

0 commit comments

Comments
 (0)