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

input-field: Fix crash when numlock is on and numlock_color is fallback #673

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

nasirHo
Copy link
Contributor

@nasirHo nasirHo commented Feb 2, 2025

Issue

Hyprlock crashes in updateColors() when:

  • Numlock is enabled.
  • colorConfig.num is a fallback value.

There is an inconsistency in condition checks when assigning and later using targetGrad:

  1. When assigning targetGrad (Line 409), the condition checks both:

    • Whether numlock is enabled.
    • Whether colorConfig.num is not a fallback.
  2. When using targetGrad (Line 421), the condition only checks for numlock, but does not check if numlock_color is a fallback.

    • If numlock_color is a fallback, targetGrad remains nullptr, leading to a crash.

Fix

  • Updated the condition in Line 421 to match the condition used when assigning targetGrad.

When numlock is enabled but numlock_color is fallback, `targetGrad`
remains nullptr. This causes Hyprlock to crash in updateColors().

This commit aligns the condition check for assigning `targetGrad` with
later usages.
@PaideiaDilemma
Copy link
Collaborator

Thanks!

@PaideiaDilemma PaideiaDilemma merged commit 465148a into hyprwm:main Feb 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants