Skip to content

Commit

Permalink
Fix null check in S.Diagnostics.Contract regressed by nullability ann…
Browse files Browse the repository at this point in the history
…otations (dotnet#41382)

* Fix null check in S.Diagnostics.Contract regressed by nullability annotations

* fix product per Jan's recommendation
  • Loading branch information
krwq authored Aug 27, 2020
1 parent 2f1ece1 commit 2337a35
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ private static void AssertMustUseRewriter(ContractFailureKind kind, string contr
Assembly? probablyNotRewritten = null;
for (int i = 0; i < stack.FrameCount; i++)
{
Assembly? caller = stack.GetFrame(i)!.GetMethod()?.DeclaringType!.Assembly;
Assembly? caller = stack.GetFrame(i)!.GetMethod()?.DeclaringType?.Assembly;
if (caller != null && caller != thisAssembly)
{
probablyNotRewritten = caller;
Expand Down

0 comments on commit 2337a35

Please sign in to comment.