- source = this->computeNodes.find(src->getId())->second;
- destination = this->computeNodes.find(dst->getId())->second;
+ std::map<int, FatTreeNode*>::const_iterator tempIter;
+ tempIter = this->computeNodes.find(src->getId());
+
+ // xbt_die -> assert
+ if (tempIter == this->computeNodes.end()) {
+ xbt_die("Could not find the source %s [%d] in the fat tree", src->getName(), src->getId());
+ }
+ source = tempIter->second;
+ tempIter = this->computeNodes.find(dst->getId());
+ if (tempIter == this->computeNodes.end()) {
+ xbt_die("Could not find the destination %s [%d] in the fat tree", src->getName(), src->getId());
+ }