diff --git a/src/inet/physicallayer/wireless/common/neighborcache/NeighborListNeighborCache.cc b/src/inet/physicallayer/wireless/common/neighborcache/NeighborListNeighborCache.cc index fac357c5f4e..2839b6814a3 100644 --- a/src/inet/physicallayer/wireless/common/neighborcache/NeighborListNeighborCache.cc +++ b/src/inet/physicallayer/wireless/common/neighborcache/NeighborListNeighborCache.cc @@ -96,10 +96,13 @@ void NeighborListNeighborCache::addRadio(const IRadio *radio) RadioEntry *newEntry = new RadioEntry(radio); radios.push_back(newEntry); radioToEntry[radio] = newEntry; - updateNeighborLists(); - maxSpeed = radioMedium->getMediumLimitCache()->getMaxSpeed().get(); - if (maxSpeed != 0 && !updateNeighborListsTimer->isScheduled() && initialized()) - scheduleAfter(refillPeriod, updateNeighborListsTimer); + if (initialized()) { + updateNeighborLists(); + maxSpeed = radioMedium->getMediumLimitCache()->getMaxSpeed().get(); + if (maxSpeed != 0 && !updateNeighborListsTimer->isScheduled()) { + scheduleAfter(refillPeriod, updateNeighborListsTimer); + } + } } void NeighborListNeighborCache::removeRadio(const IRadio *radio) @@ -144,4 +147,3 @@ NeighborListNeighborCache::~NeighborListNeighborCache() } // namespace physicallayer } // namespace inet -