Skip to content

Commit 3b2baa7

Browse files
committed
Safety catches for invalid extra skeleton files.
1 parent 5e3eac7 commit 3b2baa7

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

xivModdingFramework/Cache/XivDependencyGraph.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,6 +1436,10 @@ private static async Task<List<XivDependencyRoot>> GetModdedRoots(string interna
14361436
/// <returns></returns>
14371437
public static XivDependencyRootInfo ExtractRootInfoFilenameOnly(string filenameWithoutExtension)
14381438
{
1439+
if(String.IsNullOrEmpty(filenameWithoutExtension))
1440+
{
1441+
return new XivDependencyRootInfo();
1442+
}
14391443
var regex = new Regex("([a-z])([0-9]{4})([a-z])([0-9]{4})");
14401444
var match = regex.Match(filenameWithoutExtension);
14411445
if(!match.Success)

xivModdingFramework/Models/FileTypes/Sklb.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public static async Task<string> GetExtraSkeletonFile(string fullMdlPath)
105105
var race = XivRaces.GetXivRace(fullMdlPath.Substring(1, 4));
106106

107107
return await GetExtraSkeletonFile(root.Info, race);
108+
108109
}
109110

110111

@@ -137,7 +138,18 @@ public static async Task<string> GetExtraSkeletonFile(XivDependencyRootInfo root
137138
{
138139
return parsedFile;
139140
}
140-
await ExtractAndParseSkel(file);
141+
142+
try
143+
{
144+
// In some cases, the extra skeleton doesn't actually exist, despite the
145+
// game files saying it should. In these cases, SE actually intends to
146+
// default to the base skel.
147+
await ExtractAndParseSkel(file);
148+
}
149+
catch
150+
{
151+
return null;
152+
}
141153
return parsedFile;
142154
}
143155

0 commit comments

Comments
 (0)