fix(tray): do not abort on a malformed orders entry - #5296
Open
Carltoffel wants to merge 1 commit into
Open
Carltoffel wants to merge 1 commit into
Carltoffel wants to merge 1 commit into
Conversation
Host's config parsing asserted that every value in "orders" is an integer. Waybar is built with b_ndebug=false, so the assert is live in release builds and a single typo in the user's config aborts the whole bar with SIGABRT and no actionable message: waybar: src/modules/sni/host.cpp:39: ... Assertion `value.isInt()' failed. [1] core dumped Skip the offending entry with a warning instead, and check that "orders" is an object before iterating it. User input should never be able to terminate waybar.
Carltoffel
force-pushed
the
fix/tray-orders-assert
branch
from
September 21, 2026 08:27
87a0596 to
81d4ebd
Compare
orders entryorders entry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Host's config parsing asserts that every value inordersis an integer:assert(value.isInt()); orders_[key] = value.asInt();Waybar builds with
b_ndebug=false, so the assert is live in release buildstoo. A single typo in a user's config takes down the whole bar with no
actionable message:
Reproducer:
This skips the offending entry with a warning instead, and checks that
ordersis an object before iterating it. User input should not be able to terminate
waybar.
After:
Related issues
None. Found while working on #4162 / #5297; independent of both.
Checklist
clang-formatninja -C build)man/) — n/a, no config surface changestray, with a valid config, anon-integer value, and
ordersset to a non-object