Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent a Rhino crash when an old type is deserialised in the CreateCustomObject component #405

Merged
merged 2 commits into from
Sep 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Grasshopper_Engine/Query/Type.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,18 @@ public static partial class Query

public static Type Type(this IGH_Param param, Caller caller = null)
{
Type type;
if (param == null)
return typeof(object);

if (param is Param_ScriptVariable)
return Type(((Param_ScriptVariable)param).TypeHint, param.Access);

type = Type(((Param_ScriptVariable)param).TypeHint, param.Access);
else if (caller != null)
return (caller.InputParams.Find(x => x.Name == param.NickName))?.DataType;

type = caller.InputParams.Find(x => x.Name == param.NickName)?.DataType;
else
return param.Type;
type = param.Type;

return type == null ? typeof(object) : type;
}

/***************************************************/
Expand Down