X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/67e88ab9635136f62aab0b9e68f05d16fab123f5..e99158dd85fe789ea5e1a40c29f196fa6c715bcf:/src/surf/plugins/energy.cpp diff --git a/src/surf/plugins/energy.cpp b/src/surf/plugins/energy.cpp index 02ffe37163..2035bb50e8 100644 --- a/src/surf/plugins/energy.cpp +++ b/src/surf/plugins/energy.cpp @@ -235,9 +235,12 @@ static void onHostDestruction(simgrid::s4u::Host& host) { if (dynamic_cast(surf_host)) return; HostEnergy *host_energy = host.extension(); - host_energy->update(); - XBT_INFO("Total energy of host %s: %f Joules", - host.name().c_str(), host_energy->getConsumedEnergy()); + if (host_energy != nullptr) + { + host_energy->update(); + XBT_INFO("Total energy of host %s: %f Joules", + host.name().c_str(), host_energy->getConsumedEnergy()); + } } /* **************************** Public interface *************************** */