Skip to content

Commit 59e3312

Browse files
authored
Fixes a null pointer exception reported by the PChecker (#713)
1 parent bec256f commit 59e3312

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Src/PChecker/CheckerCore/Coverage/ActivityCoverageReporter.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ public void EmitCoverageReport(string coverageFile)
5353
{
5454
using (var writer = new StreamWriter(coverageFile))
5555
{
56-
WriteCoverageText(writer);
56+
if (CoverageInfo.CoverageGraph != null)
57+
{
58+
WriteCoverageText(writer);
59+
}
5760
}
5861
}
5962

Src/PCompiler/PCommandLine/CommandLine.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private static void PrintException(Exception ex)
125125
lock (ConsoleLock)
126126
{
127127
Error.Report($"[Internal Error]:\n {ex.Message}\n<Please report to the P team or create an issue on GitHub, Thanks!>");
128-
Error.Report("[PTool] unhandled exception: {0}: {1}", ex.GetType().ToString(), ex.Message);
128+
Error.Report("[PTool] unhandled exception: {0}: {1}\n Stack Trace: {2}", ex.GetType().ToString(), ex.Message, ex.StackTrace);
129129
}
130130
}
131131

0 commit comments

Comments
 (0)