From 0b9350d19b2a1921ce0558da50e13fb3ea4c747d Mon Sep 17 00:00:00 2001 From: William Wold Date: Mon, 7 Feb 2022 18:18:44 -0500 Subject: [PATCH] Check if dbus handler is null before using --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 9da8f449..371cf54d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -159,7 +159,9 @@ mod c { }; if let Some(visible) = msg.dbus_visible_set { - unsafe { dbus_handler_set_visible(dbus_handler, visible as u8) }; + if dbus_handler != std::ptr::null() { + unsafe { dbus_handler_set_visible(dbus_handler, visible as u8) }; + } } if let Some(hints) = msg.layout_hint_set {