ygimenez / Pagination-Utils

A collection of methods to make message pagination with JDA easier.
GNU Lesser General Public License v2.1
27 stars 7 forks source link

The same error of #40 but with categorize #41

Closed avurro closed 2 years ago

avurro commented 2 years ago

Checklist

Make sure that you've checked all the items below.

Describe the bug The same of #40 but for categorize

To Reproduce

See #40

Expected behavior

See #40

avurro commented 2 years ago

The problem is here: Pages.class

810   ...
811   } else if (emoji != null && Objects.equals(emoji, currCat)) {
812   ...

I think it is enough to change it to:

810   ...
811   } else if (emoji != null && (currCat == null || !Objects.equals(emoji, currCat))) {
812   ...
ygimenez commented 2 years ago

Objects.equals() already considers null values as false, I just need to follow the debugger to see where it's falling. In the past case it was because it was comparing the Emote with the wrong collection, so it might be something similar in this case.

However, since it's very late where I live I'll only be able to solve it tomorrow.

avurro commented 2 years ago

In this case the null value must be evaluated as true and the adjacent condition negated.

this is the condition that indicates whether to change content or not. The current page must be different from the clicked one and not the same (if I understand correctly)

ygimenez commented 2 years ago

Issue fixed in release 3.0.8

avurro commented 2 years ago

thanks 👍