diff --git a/emper/Runtime.cpp b/emper/Runtime.cpp
index a49128b9c3fe71af90ea0e6eac8176069d2e8250..31c7b1c232545aeddd141fa6f9348554bf29d6e9 100644
--- a/emper/Runtime.cpp
+++ b/emper/Runtime.cpp
@@ -165,7 +165,10 @@ Runtime::~Runtime() {
 	// objects bound to the runtime's lifetime
 	if constexpr (emper::STATS) {
 		printLastRuntimeStats();
-		emper::io::Stats::printStats(globalIo, ioContexts);
+
+		if constexpr (emper::IO) {
+			emper::io::Stats::printStats(globalIo, ioContexts);
+		}
 	}
 
 	for (unsigned int i = 0; i < workerCount; ++i) {