Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sonar don't like comments ending with ';'
[simgrid.git] / src / kernel / activity / MailboxImpl.cpp
index bed10c2..8a68981 100644 (file)
@@ -53,7 +53,10 @@ MailboxImpl* MailboxImpl::byNameOrCreate(const char* name)
  */
 void MailboxImpl::setReceiver(s4u::ActorPtr actor)
 {
-  this->permanent_receiver = actor.get()->getImpl();
+  if (actor != nullptr)
+    this->permanent_receiver = actor.get()->getImpl();
+  else
+    this->permanent_receiver = nullptr;
 }
 /** @brief Pushes a communication activity into a mailbox
  *  @param comm What to add