mirror of
https://github.com/labwc/labwc.git
synced 2025-10-31 22:25:34 -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
|
|
@ -2335,13 +2335,15 @@ view_has_strut_partial(struct view *view)
|
|||
view->impl->has_strut_partial(view);
|
||||
}
|
||||
|
||||
/* Note: It is safe to assume that this function never returns NULL */
|
||||
const char *
|
||||
view_get_string_prop(struct view *view, const char *prop)
|
||||
{
|
||||
assert(view);
|
||||
assert(prop);
|
||||
if (view->impl->get_string_prop) {
|
||||
return view->impl->get_string_prop(view, prop);
|
||||
const char *ret = view->impl->get_string_prop(view, prop);
|
||||
return ret ? ret : "";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue