diff --git a/lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupStore.java b/lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupStore.java index fe8f85a6..b38d3902 100644 --- a/lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupStore.java +++ b/lib/src/main/java/org/asamk/signal/manager/storage/groups/GroupStore.java @@ -30,6 +30,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; +import java.nio.file.Files; import java.util.ArrayList; import java.util.Base64; import java.util.HashMap; @@ -122,7 +123,11 @@ public class GroupStore { } final var groupFileLegacy = getGroupV2FileLegacy(group.getGroupId()); if (groupFileLegacy.exists()) { - groupFileLegacy.delete(); + try { + Files.delete(groupFileLegacy.toPath()); + } catch (IOException e) { + logger.error("Failed to delete legacy group file {}: {}", groupFileLegacy, e.getMessage()); + } } } catch (IOException e) { logger.warn("Failed to cache group, ignoring: {}", e.getMessage());