From ac5e4c41069b61c3be178bb7b277e288b405c35d Mon Sep 17 00:00:00 2001 From: Mike Date: Fri, 14 Jan 2022 14:04:39 +0100 Subject: [PATCH] Fix segfault when using midi.sendShortMsg and platform vnc This fixes lp1956144 by adding a missing null check --- src/util/screensaver.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/util/screensaver.cpp b/src/util/screensaver.cpp index 2c1cc970f3b..85f1006bef9 100644 --- a/src/util/screensaver.cpp +++ b/src/util/screensaver.cpp @@ -174,8 +174,10 @@ void ScreenSaverHelper::triggerUserActivity() name=getenv("DISPLAY"); } display=XOpenDisplay(name); - XResetScreenSaver(display); - XCloseDisplay(display); + if (display != nullptr) { + XResetScreenSaver(display); + XCloseDisplay(display); + } return; } // Disabling the method with DBus since it seems to be failing on several systems.