Fix crasher on no scrollbar and mouse seek.

This commit is contained in:
Dave Davenport 2016-07-21 07:57:35 +02:00
parent 8e648e6b6a
commit 5d5c9713d7
1 changed files with 2 additions and 1 deletions

View File

@ -1573,7 +1573,8 @@ static void rofi_view_mainloop_iter ( RofiViewState *state, xcb_generic_event_t
case XCB_MOTION_NOTIFY:
{
xcb_motion_notify_event_t *xme = (xcb_motion_notify_event_t *) ev;
if ( xme->event_x >= state->scrollbar->widget.x && xme->event_x < ( state->scrollbar->widget.x + state->scrollbar->widget.w ) ) {
if ( state->scrollbar != NULL &&
xme->event_x >= state->scrollbar->widget.x && xme->event_x < ( state->scrollbar->widget.x + state->scrollbar->widget.w ) ) {
state->selected = scrollbar_clicked ( state->scrollbar, xme->event_y );
state->update = TRUE;
}