Skip to content

Commit

Permalink
Fix at one bug revealed by shpaass#199.
Browse files Browse the repository at this point in the history
pcall(require, '__nonexistent-mod__/file') doesn't fail in a way that Lua can handle.
  • Loading branch information
DaleStan committed Jan 24, 2023
1 parent fd80865 commit 34f182a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion YAFCparser/FactorioDataSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ public static bool ModPathExists(string modName, string path)

public static byte[] ReadModFile(string modName, string path)
{
var info = allMods[modName];
if (!allMods.TryGetValue(modName, out var info))
return null;
if (info.zipArchive != null)
{
var entry = info.zipArchive.GetEntry(info.folder + path);
Expand Down

0 comments on commit 34f182a

Please sign in to comment.