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
This commit is contained in:
artdeell 2022-11-11 10:13:31 +03:00 committed by ArtDev
parent ca0e9e2c0d
commit bae23f770e

View File

@ -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);
}