diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebble/PBWReader.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebble/PBWReader.java index 3e3b4710..53be8a97 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebble/PBWReader.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/pebble/PBWReader.java @@ -124,10 +124,12 @@ public class PBWReader { ZipInputStream zis = new ZipInputStream(afin); ZipEntry ze; + boolean found = false; try { while ((ze = zis.getNextEntry()) != null) { if (ze.getName().startsWith(dir)) { platformDir = dir; + found = true; break; } } @@ -135,6 +137,9 @@ public class PBWReader { } catch (IOException e) { e.printStackTrace(); } + if (found) { + break; + } } if (platform.equals("chalk") && platformDir.equals("")) {