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

#1450 comment equals #1451

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion ClosedXML/Excel/RichText/XLFormattedText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public bool Equals(IXLFormattedText<T> other)

for (Int32 i = 0; i < count; i++)
{
if (_richTexts.ElementAt(i) != other.ElementAt(i))
if (_richTexts.ElementAt(i).Equals(other.ElementAt(i)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the == and != operators not be overloaded to avoid this situation?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, it's a good practice to have a consistent behavior between Equals and ==

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible NRE.

return false;
}

Expand Down