Skip to content

Commit

Permalink
input-field: Fix crash when numlock is on and numlock_color is fallba…
Browse files Browse the repository at this point in the history
…ck (#673)

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.
  • Loading branch information
nasirHo authored Feb 3, 2025
1 parent c976b6a commit 465148a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/renderer/widgets/PasswordInputField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ void CPasswordInputField::updateColors() {
CHyprColor innerTarget = colorConfig.inner;
CHyprColor fontTarget = (displayFail) ? colorConfig.fail->m_vColors.front() : colorConfig.font;

if (checkWaiting || displayFail || g_pHyprlock->m_bCapsLock || NUMLOCK) {
if (checkWaiting || displayFail || g_pHyprlock->m_bCapsLock || (NUMLOCK && !colorConfig.num->m_bIsFallback)) {
if (BORDERLESS && colorConfig.swapFont) {
fontTarget = targetGrad->m_vColors.front();
} else if (BORDERLESS && !colorConfig.swapFont) {
Expand Down

0 comments on commit 465148a

Please sign in to comment.