From e6311ecb37c593501be4ffae928442f0c443de67 Mon Sep 17 00:00:00 2001 From: James Frowen Date: Sun, 31 May 2020 18:35:22 +0100 Subject: [PATCH] adding better error message for ResolveMethod (#1950) --- Assets/Mirror/Editor/Weaver/Resolvers.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Assets/Mirror/Editor/Weaver/Resolvers.cs b/Assets/Mirror/Editor/Weaver/Resolvers.cs index 7ac9075f8..a345e4322 100644 --- a/Assets/Mirror/Editor/Weaver/Resolvers.cs +++ b/Assets/Mirror/Editor/Weaver/Resolvers.cs @@ -17,7 +17,12 @@ public static MethodReference ResolveMethod(TypeReference tr, AssemblyDefinition Weaver.Error($"Cannot resolve method {name} without a class"); return null; } - return ResolveMethod(tr, scriptDef, method => method.Name == name); + MethodReference method = ResolveMethod(tr, scriptDef, m => m.Name == name); + if (method == null) + { + Weaver.Error($"Method not found with name {name} in type {tr.Name}", tr); + } + return method; } public static MethodReference ResolveMethod(TypeReference t, AssemblyDefinition scriptDef, System.Func predicate)