diff --git a/src/core/hyprlock.cpp b/src/core/hyprlock.cpp index 56a6248..2dc881c 100644 --- a/src/core/hyprlock.cpp +++ b/src/core/hyprlock.cpp @@ -941,11 +941,16 @@ void CHyprlock::acquireSessionLock() { void CHyprlock::releaseSessionLock() { Debug::log(LOG, "Unlocking session"); - if (m_bTerminate && !m_sLockState.lock) { + if (m_bTerminate) { Debug::log(ERR, "Unlock already happend?"); return; } + if (!m_sLockState.lock) { + Debug::log(ERR, "Unlock without a lock object!"); + return; + } + if (!m_bLocked) { // Would be a protocol error to allow this Debug::log(ERR, "Trying to unlock the session, but never recieved the locked event!"); @@ -977,6 +982,12 @@ void CHyprlock::onLockLocked() { void CHyprlock::onLockFinished() { Debug::log(LOG, "onLockFinished called. Seems we got yeeten. Is another lockscreen running?"); + + if (!m_sLockState.lock) { + Debug::log(ERR, "onLockFinished without a lock object!"); + return; + } + if (m_bLocked) // The `finished` event specifies that whenever the `locked` event has been recieved and the compositor sends `finished`, // `unlock_and_destroy` should be called by the client.