- xbt_assert(bandwidth_.event == nullptr, "Cannot set a second bandwidth profile to Link %s", get_cname());
- bandwidth_.event = profile->schedule(&profile::future_evt_set, this);
+ if (profile) {
+ xbt_assert(bandwidth_.event == nullptr, "Cannot set a second bandwidth profile to Link %s", get_cname());
+ bandwidth_.event = profile->schedule(&profile::future_evt_set, this);
+ }
+ return this;