From 07aeef1f7ee2e5c48846fcdbd651fc8162c02c57 Mon Sep 17 00:00:00 2001 From: Leonardo Hernández Hernández Date: Fri, 9 Aug 2024 21:34:02 -0600 Subject: guarantee client_get_{title,appid} never return NULL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ΔSLOC: -6 --- client.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'client.h') diff --git a/client.h b/client.h index 3dc1050..e0c45fd 100644 --- a/client.h +++ b/client.h @@ -126,9 +126,9 @@ client_get_appid(Client *c) { #ifdef XWAYLAND if (client_is_x11(c)) - return c->surface.xwayland->class; + return c->surface.xwayland->class ? c->surface.xwayland->class : "broken"; #endif - return c->surface.xdg->toplevel->app_id; + return c->surface.xdg->toplevel->app_id ? c->surface.xdg->toplevel->app_id : "broken"; } static inline void @@ -200,9 +200,9 @@ client_get_title(Client *c) { #ifdef XWAYLAND if (client_is_x11(c)) - return c->surface.xwayland->title; + return c->surface.xwayland->title ? c->surface.xwayland->title : "broken"; #endif - return c->surface.xdg->toplevel->title; + return c->surface.xdg->toplevel->title ? c->surface.xdg->toplevel->title : "broken"; } static inline int -- cgit v1.2.3