From 3ca286b0b4bd3e3cee3b0e0b58e6429dce969b2e Mon Sep 17 00:00:00 2001 From: columbarius Date: Thu, 15 Apr 2021 18:16:45 +0200 Subject: [PATCH] wlr_screencast: call wlr_remove_output only if global is an output --- src/screencast/wlr_screencast.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/screencast/wlr_screencast.c b/src/screencast/wlr_screencast.c index a4ec1ea..51dbea8 100644 --- a/src/screencast/wlr_screencast.c +++ b/src/screencast/wlr_screencast.c @@ -594,8 +594,11 @@ static void wlr_registry_handle_add(void *data, struct wl_registry *reg, static void wlr_registry_handle_remove(void *data, struct wl_registry *reg, uint32_t id) { - wlr_remove_output( - xdpw_wlr_output_find((struct xdpw_screencast_context *)data, NULL, id)); + struct xdpw_screencast_context *ctx = data; + struct xdpw_wlr_output *output = xdpw_wlr_output_find(ctx, NULL, id); + if (output) { + wlr_remove_output(output); + } } static const struct wl_registry_listener wlr_registry_listener = {