From b3d17a5b7fb6c16320ae726b2b2a5a658ce4f45f Mon Sep 17 00:00:00 2001 From: Florian Schmaus <flow@cs.fau.de> Date: Fri, 13 Jul 2018 13:51:14 +0200 Subject: [PATCH] Emit an error if currentRuntime is not set in printLastRuntimeStats --- emper/Runtime.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/emper/Runtime.cpp b/emper/Runtime.cpp index a4106e9b..704d438c 100644 --- a/emper/Runtime.cpp +++ b/emper/Runtime.cpp @@ -126,7 +126,12 @@ void Runtime::printStats() { } void Runtime::printLastRuntimeStats() { - assert(currentRuntime); + std::lock_guard<std::mutex> lock(currentRuntimeMutex); + if (currentRuntime == nullptr) { + LOGE("Could not print current runtime stats"); + return; + } + currentRuntime->printStats(); } -- GitLab