android: EmulationActivity: Fix a crash when controller is disconnected.
This commit is contained in:
parent
1882dba04f
commit
03be46f7df
@ -432,6 +432,12 @@ public final class EmulationActivity extends AppCompatActivity {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
InputDevice input = event.getDevice();
|
InputDevice input = event.getDevice();
|
||||||
|
|
||||||
|
if (input == null) {
|
||||||
|
// Controller was disconnected
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return NativeLibrary.onGamePadEvent(input.getDescriptor(), button, action);
|
return NativeLibrary.onGamePadEvent(input.getDescriptor(), button, action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user