Skip to content

Commit 2f2d935

Browse files
committed
- Extra try-catch on texture failures to prevent full application crash.
- Fix for redundant additions of races to the texture tab races list due to invalid int cast.
1 parent 1025159 commit 2f2d935

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

xivModdingFramework/Mods/Modding.cs

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -161,29 +161,35 @@ public void CreateModlist()
161161
/// <returns>The mod entry if found, null otherwise</returns>
162162
public Task<Mod> TryGetModEntry(string internalFilePath)
163163
{
164-
if(String.IsNullOrWhiteSpace(internalFilePath))
164+
try
165165
{
166-
return null;
167-
}
166+
if (String.IsNullOrWhiteSpace(internalFilePath))
167+
{
168+
return null;
169+
}
168170

169-
return Task.Run(() =>
170-
{
171-
internalFilePath = internalFilePath.Replace("\\", "/");
171+
return Task.Run(() =>
172+
{
173+
internalFilePath = internalFilePath.Replace("\\", "/");
172174

173-
var modList = GetModList();
175+
var modList = GetModList();
174176

175-
if (modList == null) return null;
177+
if (modList == null) return null;
176178

177-
foreach (var modEntry in modList.Mods)
178-
{
179-
if (modEntry.fullPath.Equals(internalFilePath))
179+
foreach (var modEntry in modList.Mods)
180180
{
181-
return modEntry;
181+
if (modEntry.fullPath.Equals(internalFilePath))
182+
{
183+
return modEntry;
184+
}
182185
}
183-
}
184186

187+
return null;
188+
});
189+
} catch(Exception ex)
190+
{
185191
return null;
186-
});
192+
}
187193
}
188194

189195
/// <summary>

0 commit comments

Comments
 (0)