Commit 75922427 authored by Geoffrey Métais's avatar Geoffrey Métais

Prevent NPE for unknown device

CID #1270883
parent b67e407c
......@@ -201,9 +201,12 @@ public class AudioPlayerActivity extends Activity implements AudioServiceControl
public boolean dispatchGenericMotionEvent(MotionEvent event){
InputDevice mInputDevice = event.getDevice();
InputDevice inputDevice = event.getDevice();
float x = AndroidDevices.getCenteredAxis(event, mInputDevice,
if (inputDevice == null)
return false;
float x = AndroidDevices.getCenteredAxis(event, inputDevice,
MotionEvent.AXIS_X);
if (System.currentTimeMillis() - mLastMove > JOYSTICK_INPUT_DELAY){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment