fix: throw if id null
review comment
This commit is contained in:
+1
-1
@@ -199,7 +199,7 @@ public class CreateCollection : VariableParameterComponentBase
|
||||
if (instanceGoo.CastFrom(obj))
|
||||
{
|
||||
instanceGoo.Value.Path = childPath;
|
||||
wrapperGoo.Value.Parent = parentCollection;
|
||||
instanceGoo.Value.Parent = parentCollection;
|
||||
parentCollection.Elements.Add(instanceGoo.Value);
|
||||
}
|
||||
else
|
||||
|
||||
+6
-2
@@ -59,10 +59,14 @@ public class SpeckleBlockInstanceWrapper : SpeckleObjectWrapper
|
||||
set
|
||||
{
|
||||
_definition = value;
|
||||
|
||||
if (_definition != null)
|
||||
{
|
||||
_definition.ApplicationId ??= Guid.NewGuid().ToString();
|
||||
_instanceProxy.definitionId = _definition.ApplicationId;
|
||||
_instanceProxy.definitionId =
|
||||
_definition.ApplicationId
|
||||
?? throw new InvalidOperationException(
|
||||
"Block definition must have ApplicationId before being assigned to instance"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user