Skip to content

Commit 86980e3

Browse files
committed
Fix errors when testing whether a method has been injected
1 parent 1e65210 commit 86980e3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Editor/Aspect/Aspect.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,11 @@ static void ProcessFile(string path){
8787
* [ this , [+/-]methodName, Log ]
8888
*/
8989
static bool IsInjected(MethodDefinition m){
90+
if(m.Body.Instructions.Count < 2) return false;
9091
var i = m.Body.Instructions[1];
9192
return i.OpCode == OpCodes.Ldstr
9293
&& i.Operand is string s
94+
&& s.Length > 1
9395
&& s.Substring(1).StartsWith(m.Name);
9496

9597
}

0 commit comments

Comments
 (0)