Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions WandEnhancer/Core/Enhancer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,16 @@ private void PatchAsar()

foreach (var entry in remainingPatches.ToList())
{
var entries = enhancerConfig[entry];
// Not every EPatchType has an implementation in EnhancerConfig. Such a
// type stays in remainingPatches so it is reported by the summary below,
// rather than taking down the whole run with a KeyNotFoundException.
EnhancerConfig.PatchEntry[] entries;
if (!enhancerConfig.TryGetValue(entry, out entries))
{
_logger($"[ENHANCER] No patch definition for {entry}, skipping", ELogType.Warn);
continue;
}

foreach (var patchEntry in entries)
{
bool patchApplied;
Expand Down Expand Up @@ -189,7 +198,13 @@ private static bool CouldFileContainRemainingPatch(string filePath, IEnumerable<
{
foreach (var patchType in remainingPatches)
{
foreach (var patchEntry in enhancerConfig[patchType])
EnhancerConfig.PatchEntry[] entries;
if (!enhancerConfig.TryGetValue(patchType, out entries))
{
continue;
}

foreach (var patchEntry in entries)
{
if (patchEntry.Applied)
{
Expand Down