Update Controllers.java

This commit is contained in:
ShirosakiMio 2024-05-29 09:45:34 +08:00
parent 522f302bd8
commit b84d017f97
1 changed files with 6 additions and 0 deletions

View File

@ -31,6 +31,9 @@ public class Controllers {
public static Controller DEFAULT_CONTROLLER;
public static void checkControllers() {
if (controllers.contains(null)) {
controllers.remove(null);
}
if (controllers.isEmpty()) {
try {
if (DEFAULT_CONTROLLER == null) {
@ -117,6 +120,9 @@ public class Controllers {
}
public static ObservableList<Controller> getControllers() {
if (controllers.contains(null)) {
controllers.remove(null);
}
if (controllers.isEmpty()) controllers.add(DEFAULT_CONTROLLER);
return controllers;
}