From 27cc7389856d34c3d289b01f5b4c677690cd7aeb Mon Sep 17 00:00:00 2001 From: tokyo4j Date: Sun, 12 Oct 2025 23:59:04 +0900 Subject: [PATCH] osd-thumbnail: make sure item->{normal,active}_title are non-null The if-statement doesn't make sense, because `view_get_string_prop()` never returns NULL. And if it did, it would cause segfault in `osd_thumbnail_update()`. --- src/osd/osd-thumbnail.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/osd/osd-thumbnail.c b/src/osd/osd-thumbnail.c index 24505a31..d17f6fc3 100644 --- a/src/osd/osd-thumbnail.c +++ b/src/osd/osd-thumbnail.c @@ -156,14 +156,12 @@ create_item_scene(struct wlr_scene_tree *parent, struct view *view, /* title */ const char *title = view_get_string_prop(view, "title"); - if (title) { - item->normal_title = create_title(item->tree, switcher_theme, - title, theme->osd_label_text_color, - theme->osd_bg_color, title_y); - item->active_title = create_title(item->tree, switcher_theme, - title, theme->osd_label_text_color, - switcher_theme->item_active_bg_color, title_y); - } + item->normal_title = create_title(item->tree, switcher_theme, + title, theme->osd_label_text_color, + theme->osd_bg_color, title_y); + item->active_title = create_title(item->tree, switcher_theme, + title, theme->osd_label_text_color, + switcher_theme->item_active_bg_color, title_y); /* icon */ int icon_size = switcher_theme->item_icon_size;