v2.5.3: added a safety check to controller handler

This commit is contained in:
Evan Debenham
2024-09-30 18:33:19 -04:00
parent 79c2350cb1
commit fe4e3ef708

View File

@@ -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 ){