diff --git a/emper/Runtime.cpp b/emper/Runtime.cpp
index a4106e9b794399904547424bb9a48c46cb449a78..704d438ccfb90fe8c65f6148e63a668a086e75dd 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();
 }