Skip to content

Commit

Permalink
Merge pull request #43352 from sharwell/failfast-nre
Browse files Browse the repository at this point in the history
Fix NullReferenceException in FailFast handling
  • Loading branch information
sharwell authored Apr 15, 2020
2 parents f3f6268 + c90aa78 commit 72b31ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/Compilers/Core/Portable/InternalUtilities/FailFast.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@ internal static void DumpStackTrace(Exception? exception = null, string? message
if (exception is object)
{
Console.WriteLine("Exception info");
for (Exception? current = exception; current is object; current = current!.InnerException)
for (Exception? current = exception; current is object; current = current.InnerException)
{
Console.WriteLine(current.Message);
Console.WriteLine(current.StackTrace);
current = current.InnerException;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private SqlConnection(sqlite3 handle, IPersistentStorageFaultInjector faultInjec
{
var ex = new InvalidOperationException("SqlConnection was not properly closed");
_faultInjector?.OnFatalError(ex);
FatalError.Report(new InvalidOperationException("SqlConnection was not properly closed"));
FatalError.Report(ex);
}
}

Expand Down

0 comments on commit 72b31ae

Please sign in to comment.