From f77dbd234236322d99ae4df6bf07d06db7709d3a Mon Sep 17 00:00:00 2001 From: rcaridade145 Date: Sat, 22 Feb 2020 11:59:45 +0000 Subject: Introduce nullpointer checks and return null if validation fails --- src/core/frame.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/core/frame.c b/src/core/frame.c index f6e884a5..7ad74e5e 100644 --- a/src/core/frame.c +++ b/src/core/frame.c @@ -408,10 +408,13 @@ meta_frame_sync_to_window (MetaFrame *frame, cairo_region_t * meta_frame_get_frame_bounds (MetaFrame *frame) { - return meta_ui_get_frame_bounds (frame->window->screen->ui, - frame->xwindow, - frame->rect.width, - frame->rect.height); + if(frame->xwindow && frame->window !=NULL && frame->window->screen !=NULL && frame->window->screen->ui !=NULL) { + return meta_ui_get_frame_bounds (frame->window->screen->ui, + frame->xwindow, + frame->rect.width, + frame->rect.height); + } + return NULL; } void -- cgit v1.2.1