From fd931b0b536be64655b3dc364762a69587c3c6b5 Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Mon, 13 Aug 2018 16:43:10 -0400 Subject: [PATCH] fix: Fixing potential null ref --- ICD.Common.Utils/ThreadingUtils.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ICD.Common.Utils/ThreadingUtils.cs b/ICD.Common.Utils/ThreadingUtils.cs index 072d6dd..51a72af 100644 --- a/ICD.Common.Utils/ThreadingUtils.cs +++ b/ICD.Common.Utils/ThreadingUtils.cs @@ -215,7 +215,11 @@ namespace ICD.Common.Utils private string BuildName() { - return string.Format("{0}.{1}", MethodInfo.DeclaringType.Name, MethodInfo.GetSignature(true)); + Type declaring = MethodInfo.DeclaringType; + + return declaring == null + ? MethodInfo.GetSignature(true) + : string.Format("{0}.{1}", declaring.Name, MethodInfo.GetSignature(true)); } } }