Skip to content

Commit 2267829

Browse files
committed
Extra try-catch.
1 parent 8a7f841 commit 2267829

File tree

1 file changed

+9
-3
lines changed
  • xivModdingFramework/Mods/FileTypes

1 file changed

+9
-3
lines changed

xivModdingFramework/Mods/FileTypes/TTMP.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ await Task.Run(async () =>
682682

683683
// ModList is updated now. Time to expand the Metadata files.
684684
Dictionary<XivDataFile, IndexFile> indexFiles = new Dictionary<XivDataFile, IndexFile>();
685-
Dictionary<XivDataFile, List<ItemMetadata>> metadataEntries = new Dictionary<XivDataFile, List<ItemMetadata>>;
685+
Dictionary<XivDataFile, List<ItemMetadata>> metadataEntries = new Dictionary<XivDataFile, List<ItemMetadata>>();
686686
foreach (var file in filePaths)
687687
{
688688
if (ErroneousFiles.Contains(file)) continue;
@@ -717,10 +717,16 @@ await Task.Run(async () =>
717717
}
718718
}
719719

720-
foreach(var ifKv in indexFiles)
720+
try
721721
{
722-
await ItemMetadata.ApplyMetadataBatched(metadataEntries[ifKv.Key], ifKv.Value, modList);
722+
foreach (var ifKv in indexFiles)
723+
{
724+
await ItemMetadata.ApplyMetadataBatched(metadataEntries[ifKv.Key], ifKv.Value, modList);
723725

726+
}
727+
} catch(Exception Ex)
728+
{
729+
throw new Exception("An error occured when attempting to expand the metadata entries.\n\nError:" + Ex.Message);
724730
}
725731

726732
foreach(var kv in indexFiles)

0 commit comments

Comments
 (0)