Skip to content

Fix the both-null guard in SorterBase to test the right-hand side - #9098

Merged
ckerr merged 1 commit into
transmission:mainfrom
darkdi:fix/sorterbase-null-check
Sep 4, 2026
Merged

ckerr merged 1 commit into
transmission:mainfrom
darkdi:fix/sorterbase-null-check

Conversation

@darkdi

@darkdi darkdi commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

In SorterBase<T>::compare_vfunc the "both sides failed to cast" guard tests concrete_lhs twice, so it never looks at the right side at all. The two g_return_val_if_fail lines under it are written to separate the one-sided cases, and the first of them can't be reached the way it stands: with concrete_lhs null and concrete_rhs fine, the guard already fired and returned EQUAL instead of SMALLER.

This only shows up on the GTK4 path when Glib::wrap_auto hands back something that isn't a T, which is why nothing has complained about it. The names sit next to each other on consecutive lines, which is probably how it happened.

@ckerr
ckerr merged commit 48835c6 into transmission:main Sep 4, 2026
37 checks passed
@ckerr ckerr added scope:gtk type:fix A bug fix notes:none Should not be listed in release notes labels Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes:none Should not be listed in release notes scope:gtk type:fix A bug fix

Development

Successfully merging this pull request may close these issues.

2 participants