From 714a85119dbfb4858fd8138ca4b8506c5807fe1b Mon Sep 17 00:00:00 2001 From: Hamish Milne Date: Wed, 1 Apr 2020 22:50:19 +0100 Subject: [PATCH] Don't crash when getting perf stats --- src/core/core.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/core.cpp b/src/core/core.cpp index 1e48c0c620..2a99d3ccc2 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -296,7 +296,8 @@ void System::PrepareReschedule() { } PerfStats::Results System::GetAndResetPerfStats() { - return perf_stats->GetAndResetStats(timing->GetGlobalTimeUs()); + return (perf_stats && timing) ? perf_stats->GetAndResetStats(timing->GetGlobalTimeUs()) + : PerfStats::Results{}; } void System::Reschedule() {