fix crash when switch dark mode

This commit is contained in:
ShirosakiMio 2024-09-09 16:40:01 +08:00
parent b464282f4a
commit f7ff5ea3cb
5 changed files with 9 additions and 4 deletions

View File

@ -243,7 +243,7 @@ public final class Accounts {
*/
static void init() {
if (initialized)
throw new IllegalStateException("Already initialized");
return;
loadGlobalAccountStorages();

View File

@ -62,7 +62,7 @@ public final class ConfigHolder {
public synchronized static void init() throws IOException {
if (configInstance != null) {
throw new IllegalStateException("Configuration is already loaded");
return;
}
configInstance = loadConfig();

View File

@ -95,7 +95,7 @@ public class Controllers {
public static void init() {
if (initialized)
throw new IllegalStateException("Already initialized");
return;
controllers.addAll(getControllersFromDisk());
checkControllers();

View File

@ -135,7 +135,7 @@ public final class Profiles {
static void init() {
if (initialized)
throw new IllegalStateException("Already initialized");
return;
HashSet<String> names = new HashSet<>();
config().getConfigurations().forEach((name, profile) -> {

View File

@ -24,6 +24,7 @@ class ManagePageManager(
const val PAGE_ID_MANAGE_MOD: Int = 15003
const val PAGE_ID_MANAGE_WORLD: Int = 15004
}
var profile: Profile? = null
var version: String? = null
@ -61,6 +62,7 @@ class ManagePageManager(
)
versionSettingPage
}
PAGE_ID_MANAGE_INSTALL -> {
installerListPage = InstallerListPage(
context,
@ -70,6 +72,7 @@ class ManagePageManager(
)
installerListPage
}
PAGE_ID_MANAGE_MOD -> {
modListPage = ModListPage(
context,
@ -79,6 +82,7 @@ class ManagePageManager(
)
modListPage
}
PAGE_ID_MANAGE_WORLD -> {
worldListPage = WorldListPage(
context,
@ -88,6 +92,7 @@ class ManagePageManager(
)
worldListPage
}
else -> null
}
if (page != null) {