diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java index b40628a92..7ce14f94a 100644 --- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java @@ -1825,7 +1825,10 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, if (source == InputDevice.SOURCE_UNKNOWN) { InputDevice device = InputDevice.getDevice(deviceId); - source = device.getSources(); + if ( device != null ) + { + source = device.getSources(); + } } if ((source & InputDevice.SOURCE_KEYBOARD) != 0) {