From abddec12a411f98609eb3fb37abaad4d8297b2a0 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 27 Feb 2020 09:13:03 +0100 Subject: [PATCH] Host is not null here (for scan-build). --- src/plugins/host_energy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/host_energy.cpp b/src/plugins/host_energy.cpp index b68edc8aee..0b1ed29b96 100644 --- a/src/plugins/host_energy.cpp +++ b/src/plugins/host_energy.cpp @@ -515,7 +515,7 @@ static void on_simulation_end() double total_energy = 0.0; // Total energy consumption (whole platform) double used_hosts_energy = 0.0; // Energy consumed by hosts that computed something for (simgrid::s4u::Host const* host : simgrid::s4u::Engine::get_instance()->get_all_hosts()) { - if (dynamic_cast(host) == nullptr) { // Ignore virtual machines + if (host && dynamic_cast(host) == nullptr) { // Ignore virtual machines double energy = host->extension()->get_consumed_energy(); total_energy += energy; if (host->extension()->host_was_used_) -- 2.20.1