Skip to content

Commit 7f852d2

Browse files
committed
Extra safety checks on mod file conversions.
1 parent fba4c2d commit 7f852d2

File tree

1 file changed

+6
-0
lines changed
  • xivModdingFramework/Models/FileTypes

1 file changed

+6
-0
lines changed

xivModdingFramework/Models/FileTypes/Mdl.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4431,9 +4431,15 @@ public async Task<long> CopyModel(string originalPath, string newPath, string so
44314431
var xMdl = await GetRawMdlData(originalPath, false, offset);
44324432
var model = TTModel.FromRaw(xMdl);
44334433

4434+
if (model == null)
4435+
{
4436+
throw new InvalidDataException("Source model file does not exist.");
4437+
}
4438+
44344439
var originalRace = IOUtil.GetRaceFromPath(originalPath);
44354440
var newRace = IOUtil.GetRaceFromPath(newPath);
44364441

4442+
44374443
if(originalRace != newRace)
44384444
{
44394445
// Convert the model to the new race.

0 commit comments

Comments
 (0)