Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fix null reference exception.
Browse files Browse the repository at this point in the history
Occurred when using relative mouse mode without a focused window.
  • Loading branch information
Nemo157 committed Feb 3, 2012
1 parent d1f7576 commit 079c188
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/events/SDL_mouse.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit 079c188

Please sign in to comment.