From b801f79ee002dae64d3d964456dc04f471f998b6 Mon Sep 17 00:00:00 2001 From: Ignacio Casal Quinteiro Date: Sun, 20 Dec 2015 19:36:24 +0100 Subject: [PATCH] Fix crash if the cursor surface is null --- libgitg/gitg-platform-support.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libgitg/gitg-platform-support.c b/libgitg/gitg-platform-support.c index aaad1d82..77c0227c 100644 --- a/libgitg/gitg-platform-support.c +++ b/libgitg/gitg-platform-support.c @@ -56,6 +56,11 @@ gitg_platform_support_create_cursor_surface (GdkDisplay *display, cursor = gdk_cursor_new_for_display (display, cursor_type); surface = gdk_cursor_get_surface (cursor, hot_x, hot_y); + if (surface == NULL) + { + return NULL; + } + switch (cairo_surface_get_type (surface)) { case CAIRO_SURFACE_TYPE_XLIB: