Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fix null reference exception.

Occurred when using relative mouse mode without a focused window.
  • Loading branch information
Nemo157 committed Feb 3, 2012
1 parent d1f7576 commit 079c1880b06f2adf3ad02b043f2f8529c4c8f694
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/events/SDL_mouse.c
@@ -323,7 +323,7 @@ SDL_SetRelativeMouseMode(SDL_bool enabled)
/* Set the relative mode */
mouse->relative_mode = enabled;

if (!enabled) {
if (!enabled && mouse->focus) {
/* Restore the expected mouse position */
SDL_WarpMouseInWindow(mouse->focus, mouse->x, mouse->y);
}

0 comments on commit 079c188

Please sign in to comment.