diff --git a/src/main/java/org/myrobotlab/service/Runtime.java b/src/main/java/org/myrobotlab/service/Runtime.java index 4b5f418a39..79439eea08 100644 --- a/src/main/java/org/myrobotlab/service/Runtime.java +++ b/src/main/java/org/myrobotlab/service/Runtime.java @@ -3687,10 +3687,10 @@ public static Double getBatteryLevel() { // TODO This is incorrect, will not work when unplugged // and acpitool output is different than expected, // at least on Ubuntu 22.04 - consider oshi library - if (FileIO.isExecutableAvailable("acpi")) { + if (FileIO.isExecutableAvailable("acpi")) { String ret = Runtime.execute("acpi"); int pos0 = ret.indexOf("%"); - + if (pos0 != -1) { int pos1 = ret.lastIndexOf(" ", pos0); // int pos1 = ret.indexOf("%", pos0);