From: Martin Quinson Date: Mon, 1 May 2017 20:54:36 +0000 (+0200) Subject: Fix the execution with NS3 X-Git-Tag: v3.16~295 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8bb47960d8dc57e8c78ad93582682de25c6e901e Fix the execution with NS3 --- diff --git a/src/smpi/smpi_global.cpp b/src/smpi/smpi_global.cpp index 39d769a62e..0ae9822500 100644 --- a/src/smpi/smpi_global.cpp +++ b/src/smpi/smpi_global.cpp @@ -95,7 +95,10 @@ int smpi_process_count() simgrid::smpi::Process* smpi_process() { - simgrid::MsgActorExt* msgExt = static_cast(SIMIX_process_self()->data); + smx_actor_t me = SIMIX_process_self(); + if (me == nullptr) // This happens sometimes (eg, when linking against NS3 because it pulls openMPI...) + return nullptr; + simgrid::MsgActorExt* msgExt = static_cast(me->data); return static_cast(msgExt->data); }