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(){
|
public static boolean vibrationSupported(){
|
||||||
|
try {
|
||||||
|
//library can throw a NPE here is controller was disconnected during sleep
|
||||||
return isControllerConnected() && Controllers.getCurrent().canVibrate();
|
return isControllerConnected() && Controllers.getCurrent().canVibrate();
|
||||||
|
} catch (Exception e){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void vibrate( int millis ){
|
public static void vibrate( int millis ){
|
||||||
|
|||||||
Reference in New Issue
Block a user