fix: Fixing potential null ref

This commit is contained in:
Chris Cameron
2018-08-13 16:43:10 -04:00
parent 2a222289ca
commit fd931b0b53

View File

@@ -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));
}
}
}