Skip to content

Commit

Permalink
fix: Error when right-clicking on a nested list
Browse files Browse the repository at this point in the history
  • Loading branch information
fuqunaga committed Aug 27, 2024
1 parent 310a3bb commit 090bae6
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ public MenuItem(string name, Action action)
this.name = name;
this.action = action;
}



// 名前で比較する
// Separator同士は一致させない
private class NameComparerImpl : IEqualityComparer<MenuItem>
{
public bool Equals(MenuItem x, MenuItem y)
Expand All @@ -36,7 +37,7 @@ public bool Equals(MenuItem x, MenuItem y)

public int GetHashCode(MenuItem obj)
{
return obj.name.GetHashCode();
return obj.name?.GetHashCode() ?? 0;
}
}
}
Expand Down

0 comments on commit 090bae6

Please sign in to comment.