From 9cdeee6ca6b2bac0bee3bf463123ea0691001fb2 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 10 Sep 2024 04:29:10 +0100 Subject: [PATCH] library: safety check for osr ack --- src/library/plugin/plugin.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/library/plugin/plugin.c b/src/library/plugin/plugin.c index ab1ad45..6de6825 100644 --- a/src/library/plugin/plugin.c +++ b/src/library/plugin/plugin.c @@ -549,10 +549,12 @@ void _bolt_plugin_handle_messages() { } } - const struct BoltIPCMessageToHost message = {.message_type = IPC_MSG_OSRUPDATE_ACK}; - _bolt_ipc_send(fd, &message, sizeof(message)); - _bolt_ipc_send(fd, &(*window)->plugin_id, sizeof((*window)->plugin_id)); - _bolt_ipc_send(fd, &window_id, sizeof(window_id)); + if (window) { + const struct BoltIPCMessageToHost message = {.message_type = IPC_MSG_OSRUPDATE_ACK}; + _bolt_ipc_send(fd, &message, sizeof(message)); + _bolt_ipc_send(fd, &(*window)->plugin_id, sizeof((*window)->plugin_id)); + _bolt_ipc_send(fd, &window_id, sizeof(window_id)); + } break; } default: