Skip to content

Commit 08ea4a1

Browse files
committed
fix the bug
1 parent e1dac11 commit 08ea4a1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/java/dev/colbster937/eaglercraft/storage/DirStorage.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,12 @@ public void delete(IProgressUpdate prog, String name) {
150150
int i = 0;
151151
updateProgress(prog, I18n.format("storage.deleting"));
152152
for (VFile2 file : files) {
153-
updateProgress(prog, I18n.format("storage.deleting.file", file.getPath().substring(subpath + 1)),
154-
(int) Math.round((++i * 100.0) / files.size()));
155-
if (file.exists())
156-
file.delete();
153+
if (file.getPath().startsWith(_root.getPath() + "/")) {
154+
updateProgress(prog, I18n.format("storage.deleting.file", file.getPath().substring(subpath + 1)),
155+
(int) Math.round((++i * 100.0) / files.size()));
156+
if (file.exists())
157+
file.delete();
158+
}
157159
}
158160
removeFromManifest(name);
159161
}

0 commit comments

Comments
 (0)