mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
xwayland: Prevents usage of invalid data pointer
There are situations where the data pointer of a parent is NULL. Checking for NULL first fixes e.g. a segmentation fault in CLion when opening the settings window from a popup menu. See also https://github.com/labwc/labwc/issues/1351#issuecomment-1867475324
This commit is contained in:
parent
1e807ce654
commit
44c79c4963
1 changed files with 1 additions and 1 deletions
|
|
@ -543,7 +543,7 @@ init_foreign_toplevel(struct view *view)
|
|||
return;
|
||||
}
|
||||
struct view *parent = (struct view *)surface->parent->data;
|
||||
if (!parent->toplevel.handle) {
|
||||
if (!parent || !parent->toplevel.handle) {
|
||||
return;
|
||||
}
|
||||
wlr_foreign_toplevel_handle_v1_set_parent(view->toplevel.handle, parent->toplevel.handle);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue