Browse Source

Fix IndexOutOfRangeException on cmd

pull/65/head
Meivyn 3 years ago
parent
commit
19ef48ca02
No known key found for this signature in database GPG Key ID: 8BDD3E48158B2F71
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      IPA.Injector/Injector.cs

+ 3
- 3
IPA.Injector/Injector.cs View File

@ -51,7 +51,7 @@ namespace IPA.Injector
for (var i = 0; i < cmd.Length; i++) for (var i = 0; i < cmd.Length; i++)
{ {
if (cmd[i] == "-pid")
if (cmd[i] == "-pid" && cmd.Length > i + 1)
{ {
arg = cmd[i + 1]; arg = cmd[i + 1];
break; break;
@ -79,7 +79,7 @@ namespace IPA.Injector
// IMPORTANT: NO CALLS TO ANY LOGGER CAN HAPPEN BEFORE THIS // IMPORTANT: NO CALLS TO ANY LOGGER CAN HAPPEN BEFORE THIS
var unused = StandardLogger.PrintFilter; var unused = StandardLogger.PrintFilter;
#region // Above hack explaination #region // Above hack explaination
/*
/*
* Due to an unknown bug in the version of Mono that Unity uses, if the first access to StandardLogger * Due to an unknown bug in the version of Mono that Unity uses, if the first access to StandardLogger
* is a call to a constructor, then Mono fails to load the type correctly. However, if the first access is to * is a call to a constructor, then Mono fails to load the type correctly. However, if the first access is to
* the above static property (or maybe any, but I don't really know) it behaves as expected and works fine. * the above static property (or maybe any, but I don't really know) it behaves as expected and works fine.
@ -275,7 +275,7 @@ namespace IPA.Injector
using var ascModule = VirtualizedModule.Load(ascPath); using var ascModule = VirtualizedModule.Load(ascPath);
ascModule.Virtualize(cAsmName, () => bkp?.Add(ascPath)); ascModule.Virtualize(cAsmName, () => bkp?.Add(ascPath));
} }
catch (Exception e)
catch (Exception e)
{ {
injector.Error($"Could not virtualize {ascPath}"); injector.Error($"Could not virtualize {ascPath}");
if (SelfConfig.Debug_.ShowHandledErrorStackTraces_) if (SelfConfig.Debug_.ShowHandledErrorStackTraces_)


Loading…
Cancel
Save