Skip to content

Commit fe1db13

Browse files
committed
Added: Basic Error Handling for Current Process DRM Check
1 parent 9bd5607 commit fe1db13

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

source/Reloaded.Mod.Loader/EntryPoint.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,15 @@ private static void LoadMods(IReloadedHooks hooks)
145145
}
146146
else
147147
{
148-
var basicPeParser = new BasicPeParser(Environment.CurrentProcessLocation.Value);
149-
drmTypes = CheckDrmAndNotify(basicPeParser, _loader.Logger, out requiresDelayStart);
148+
try
149+
{
150+
var basicPeParser = new BasicPeParser(Environment.CurrentProcessLocation.Value);
151+
drmTypes = CheckDrmAndNotify(basicPeParser, _loader.Logger, out requiresDelayStart);
152+
}
153+
catch (Exception e)
154+
{
155+
Logger?.LogWriteLineAsync($"Failed to check DRM. Probably unable to read EXE file.", Logger.ColorWarning);
156+
}
150157
}
151158

152159
if (!requiresDelayStart || loadedFromExternalSource)

0 commit comments

Comments
 (0)