v2.5.3: added a safety check to controller handler
This commit is contained in:
@@ -85,7 +85,12 @@ public class ControllerHandler implements ControllerListener {
|
||||
}
|
||||
|
||||
public static boolean vibrationSupported(){
|
||||
return isControllerConnected() && Controllers.getCurrent().canVibrate();
|
||||
try {
|
||||
//library can throw a NPE here is controller was disconnected during sleep
|
||||
return isControllerConnected() && Controllers.getCurrent().canVibrate();
|
||||
} catch (Exception e){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void vibrate( int millis ){
|
||||
|
||||
Reference in New Issue
Block a user