From 1fa31b4eabdce66ff016ccb8a04f9c3b393d5267 Mon Sep 17 00:00:00 2001 From: Kashinath Patkar <100040786+Kashinathpat@users.noreply.github.com> Date: Tue, 9 Jul 2024 12:04:22 +0530 Subject: [PATCH] Fix Shortcuts crash --- app/src/main/java/com/winlator/container/Shortcut.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/winlator/container/Shortcut.java b/app/src/main/java/com/winlator/container/Shortcut.java index ae5bcfde..8a26b4ec 100644 --- a/app/src/main/java/com/winlator/container/Shortcut.java +++ b/app/src/main/java/com/winlator/container/Shortcut.java @@ -36,9 +36,10 @@ public Shortcut(Container container, File file) { int index; for (String line : FileUtils.readLines(file)) { - index = line.indexOf("["); - if (index != -1) { - section = line.substring(index+1, line.indexOf("]", index)); + line = line.trim(); + if (line.isEmpty() || line.startsWith("#")) continue; // Skip empty lines and comments + if (line.startsWith("[")) { + section = line.substring(1, line.indexOf("]")); } else { index = line.indexOf("=");