Skip to content

ui: Don't panic on invalid highlight indices in HighlightedLabel (#57291) (cherry-pick to stable)#57366

Merged
zed-zippy[bot] merged 1 commit into
v1.3.xfrom
cherry-pick-v1.3.x-7f7c2153
May 21, 2026
Merged

ui: Don't panic on invalid highlight indices in HighlightedLabel (#57291) (cherry-pick to stable)#57366
zed-zippy[bot] merged 1 commit into
v1.3.xfrom
cherry-pick-v1.3.x-7f7c2153

Conversation

@zed-zippy

@zed-zippy zed-zippy Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

Cherry-pick of #57291 to stable


HighlightedLabel would crash the application if any provided highlight
index was invalid. In theory, this should never happen. In practice,
this can happen due to race conditions at call sites.

After this change, we only panic in debug builds. In release builds, we
log an error and return a label with no highlights. The error message
includes the call site so that it's easier to fix the root cause.

Related to #57290

Part of FR-11.

Release Notes:

  • N/A

…57291)

HighlightedLabel would crash the application if any provided highlight
index was invalid. In theory, this should never happen. In practice,
this can happen due to race conditions at call sites.

After this change, we only panic in debug builds. In release builds, we
log an error and return a label with no highlights. The error message
includes the call site so that it's easier to fix the root cause.

Related to #57290

Part of FR-11.

Release Notes:

- N/A
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 21, 2026
@zed-community-bot zed-community-bot Bot added the bot Pull requests authored by a bot label May 21, 2026
@zed-zippy zed-zippy Bot merged commit 03db635 into v1.3.x May 21, 2026
41 checks passed
@zed-zippy zed-zippy Bot deleted the cherry-pick-v1.3.x-7f7c2153 branch May 21, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot Pull requests authored by a bot cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant