diff --git a/src/lte/helper/point-to-point-epc-helper.cc b/src/lte/helper/point-to-point-epc-helper.cc index a064fb9b7..0bc8d96ec 100644 --- a/src/lte/helper/point-to-point-epc-helper.cc +++ b/src/lte/helper/point-to-point-epc-helper.cc @@ -569,10 +569,17 @@ PointToPointEpcHelper::DoActivateEpsBearerForUe (const Ptr &ueDevice, const EpsBearer &bearer) const { NS_LOG_FUNCTION (this); - Ptr ueLteDevice = ueDevice->GetObject (); - NS_ABORT_MSG_IF (ueLteDevice == nullptr , "Unable to find LteUeNetDevice while activating the EPS bearer"); - - Simulator::ScheduleNow (&EpcUeNas::ActivateEpsBearer, ueLteDevice->GetNas (), bearer, tft); + Ptr ueLteDevice = DynamicCast (ueDevice); + if (ueLteDevice == nullptr) + { + // You may wonder why this is not an assert. Well, take a look in epc-test-s1u-downlink + // and -uplink: we are using CSMA to simulate UEs. + NS_LOG_WARN ("Unable to find LteUeNetDevice while activating the EPS bearer"); + } + else + { + Simulator::ScheduleNow (&EpcUeNas::ActivateEpsBearer, ueLteDevice->GetNas (), bearer, tft); + } } Ptr