xwayland/window-manager: add a NULL check to fail when frame_create fails

This adds a NULL check to fail when frame_create fails. This can happen
crash in frame_resize_inside function if frame is NULL.
This commit is contained in:
Jimmy Ohn 2020-07-01 19:11:52 +09:00
parent e55c86a167
commit f7f8f5f1a8

View File

@ -1082,6 +1082,10 @@ weston_wm_window_create_frame(struct weston_wm_window *window)
window->frame = frame_create(window->wm->theme,
window->width, window->height,
buttons, window->name, NULL);
if (!window->frame)
return;
frame_resize_inside(window->frame, window->width, window->height);
weston_wm_window_get_frame_size(window, &width, &height);