Skip to content

Commit 442dd79

Browse files
committed
More validation checks for successful file deletion.
1 parent ce3a862 commit 442dd79

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

xivModdingFramework/Mods/Modding.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,16 @@ where modPack.name.Equals(modPackName)
427427
if (modToRemove.source == "FilesAddedByTexTools")
428428
{
429429
var index = new Index(_gameDirectory);
430-
index.DeleteFileDescriptor(modToRemove.fullPath, XivDataFiles.GetXivDataFile(modToRemove.datFile));
431-
index.DeleteFileDescriptor($"{modToRemove.fullPath}.flag", XivDataFiles.GetXivDataFile(modToRemove.datFile));
430+
var success = index.DeleteFileDescriptor(modToRemove.fullPath, XivDataFiles.GetXivDataFile(modToRemove.datFile));
431+
if (!success)
432+
{
433+
throw new Exception("Failed to delete file descriptor.");
434+
}
435+
success = index.DeleteFileDescriptor($"{modToRemove.fullPath}.flag", XivDataFiles.GetXivDataFile(modToRemove.datFile));
436+
if (!success)
437+
{
438+
throw new Exception("Failed to delete file descriptor.");
439+
}
432440
}
433441
if (modToRemove.enabled)
434442
{

0 commit comments

Comments
 (0)