mirror of
https://github.com/labwc/labwc.git
synced 2026-03-14 05:33:52 -04:00
view: fix NULL string_prop crash
...when app_id is NULL. Make sure view_get_string_prop() never returns NULL because it is so easy to misuse. Same for the respective xwayland/xdg impl methods in case anyone decides to (incorrectly) call them directly in future. Fixes: #2453
This commit is contained in:
parent
bad788ccdd
commit
023427b4f4
3 changed files with 8 additions and 6 deletions
|
|
@ -660,10 +660,10 @@ xdg_toplevel_view_get_string_prop(struct view *view, const char *prop)
|
|||
}
|
||||
|
||||
if (!strcmp(prop, "title")) {
|
||||
return xdg_toplevel->title;
|
||||
return xdg_toplevel->title ? xdg_toplevel->title : "";
|
||||
}
|
||||
if (!strcmp(prop, "app_id")) {
|
||||
return xdg_toplevel->app_id;
|
||||
return xdg_toplevel->app_id ? xdg_toplevel->app_id : "";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue