Skip to content

Commit

Permalink
Fix crash when adding components to a design (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekolis authored Feb 3, 2024
1 parent c57ef8a commit 68250f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion FrEee/Objects/Technology/MountedComponentTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ public override bool Equals(object? obj)

public override int GetHashCode()
{
return HashCodeMasher.Mash(Container, ComponentTemplate, Mount);
// can't mash the container itself because that would cause a circular dependency on this template
return HashCodeMasher.Mash(Container?.ID, ComponentTemplate, Mount);
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion FrEee/Utility/HashCodeMasher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace FrEee.Utility;
/// </summary>
public static class HashCodeMasher
{
public static int Mash(params object[] objs)
public static int Mash(params object?[] objs)
{
return MashList(objs);
}
Expand Down

0 comments on commit 68250f7

Please sign in to comment.