From bae23f770e7730f2ad2c6e9dcd9f6f7afdb8f391 Mon Sep 17 00:00:00 2001 From: artdeell Date: Fri, 11 Nov 2022 10:13:31 +0300 Subject: [PATCH] Add slashes to control loading paths Java's path parser won't mind an extra slash (it wouldn't be treated as a new folder) but then paths that start with dots (such as the ones from the selector) would work fine --- .../src/main/java/net/kdt/pojavlaunch/MainActivity.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/MainActivity.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/MainActivity.java index 723a2a080..f714f9344 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/MainActivity.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/MainActivity.java @@ -191,10 +191,10 @@ public class MainActivity extends BaseActivity { mControlLayout.loadLayout( minecraftProfile.controlFile == null ? LauncherPreferences.PREF_DEFAULTCTRL_PATH - : Tools.CTRLMAP_PATH + minecraftProfile.controlFile); + : Tools.CTRLMAP_PATH + "/" + minecraftProfile.controlFile); } catch(IOException e) { try { - Log.w("MainActivity", "Unable to load the control file, loading the default now"); + Log.w("MainActivity", "Unable to load the control file, loading the default now", e); mControlLayout.loadLayout(Tools.CTRLDEF_FILE); } catch (IOException ioException) { Tools.showError(this, ioException); @@ -391,7 +391,7 @@ public class MainActivity extends BaseActivity { MainActivity.mControlLayout.loadLayout( minecraftProfile.controlFile == null ? LauncherPreferences.PREF_DEFAULTCTRL_PATH - : Tools.CTRLMAP_PATH + minecraftProfile.controlFile); + : Tools.CTRLMAP_PATH + "/" + minecraftProfile.controlFile); } catch (IOException e) { Tools.showError(this,e); }