diff --git a/mi/mipointer.c b/mi/mipointer.c index 800a1f1eb7..615f737fbf 100644 --- a/mi/mipointer.c +++ b/mi/mipointer.c @@ -702,7 +702,7 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx, /* check if we generated any barrier events and if so, update root x/y * to the fully constrained coords */ - if (should_constrain_barriers) { + if (should_constrain_barriers && nevents && events) { for (i = 0; i < *nevents; i++) { if (events[i].any.type == ET_BarrierHit || events[i].any.type == ET_BarrierLeave) {