[kwin_wayland] Safety check for WaylandSeat::installCursorImage

wl_cursor_theme_get_cursor might return a null pointer - return
instead of crash.
This commit is contained in:
Martin Gräßlin 2014-08-25 15:22:21 +02:00
parent d880f7418c
commit ac25052c22

View file

@ -596,7 +596,7 @@ void WaylandSeat::installCursorImage(Qt::CursorShape shape)
loadTheme(); loadTheme();
} }
wl_cursor *c = wl_cursor_theme_get_cursor(m_theme, Cursor::self()->cursorName(shape).constData()); wl_cursor *c = wl_cursor_theme_get_cursor(m_theme, Cursor::self()->cursorName(shape).constData());
if (c->image_count <= 0) { if (!c || c->image_count <= 0) {
return; return;
} }
wl_cursor_image *image = c->images[0]; wl_cursor_image *image = c->images[0];