mirror of
https://github.com/hyprwm/hyprpaper.git
synced 2026-08-18 03:07:47 +00:00
internal: fix missing null check for g_IPCSocket in onRepeatTimer (#368)
CWallpaperTarget::onRepeatTimer() calls IPC::g_IPCSocket->onWallpaperChanged() without checking if g_IPCSocket is valid. When IPC is disabled (ipc=0) or not initialized, g_IPCSocket is nullptr, causing a SIGSEGV. Stack trace from coredump: #0 __normal_iterator constructor (this->m_statusObjects at 0x60) #1 IPC::CSocket::onWallpaperChanged (this=0x0) #2 CWallpaperTarget::onRepeatTimer GDB confirms this=0x0 in onWallpaperChanged, meaning g_IPCSocket.get() returned nullptr when dereferenced. Fix: add a null guard matching the pattern already used in registerOutput() and elsewhere in the codebase.
This commit is contained in:
@ -140,6 +140,7 @@ void CWallpaperTarget::onRepeatTimer() {
|
||||
m_timer =
|
||||
m_backend->addTimer(std::chrono::milliseconds(std::chrono::seconds(m_imagesData->timeout)), [this](ASP<Hyprtoolkit::CTimer> self, void*) { onRepeatTimer(); }, nullptr);
|
||||
|
||||
if (IPC::g_IPCSocket)
|
||||
IPC::g_IPCSocket->onWallpaperChanged(m_monitorName, m_lastPath);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user