Skip to content

Commit

Permalink
Fixed errors when a parameter is destroyed and it's reference is stil…
Browse files Browse the repository at this point in the history
…l used in the graph.
  • Loading branch information
alelievr committed Oct 1, 2021
1 parent 9aa4290 commit bc71d48
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void ISerializationCallbackReceiver.OnBeforeSerialize() {}
protected virtual Settings CreateSettings() => new Settings();

public virtual object value { get; set; }
public virtual Type GetValueType() => value.GetType();
public virtual Type GetValueType() => value == null ? typeof(object) : value.GetType();

static Dictionary<Type, Type> exposedParameterTypeCache = new Dictionary<Type, Type>();
internal ExposedParameter Migrate()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ protected override void Process()
parameter = graph.GetExposedParameterFromGUID(parameterGUID);
#endif

ClearMessages();
if (parameter == null)
{
AddMessage($"Parameter not found: {parameterGUID}", NodeMessageType.Error);
return;
}

if (accessor == ParameterAccessor.Get)
output = parameter.value;
else
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed fields with [Settings] attribute not showing up with inheritance.
- Fixed selection still active when selecting nodes without inspector fields.
- Fixed multi-selection drag and drop of edges.
- Fixed errors when a parameter is destroyed and it's reference is still used in the graph.

### Changed
- Fields with both attributes [SerializeField] and [ShowInInspector] are now visible in both the node and inspector.
Expand Down

0 comments on commit bc71d48

Please sign in to comment.