input-field: Fix crash when numlock is on and numlock_color is fallback (#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.
This commit is contained in:
IChengHo 2025-02-03 13:28:35 -05:00 committed by GitHub
parent c976b6a1d1
commit 465148ac21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {