From 56a36758ad8874ca56616e24aad37e2eac17e998 Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Thu, 19 Jul 2018 14:17:08 +0200 Subject: [PATCH] [KERNEL] Check if surf_action_ is nullptr This is also done in the other methods, so we should do that here as well. --- src/kernel/activity/ExecImpl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kernel/activity/ExecImpl.cpp b/src/kernel/activity/ExecImpl.cpp index 17fdf8da28..9cb7149ab2 100644 --- a/src/kernel/activity/ExecImpl.cpp +++ b/src/kernel/activity/ExecImpl.cpp @@ -70,9 +70,9 @@ double simgrid::kernel::activity::ExecImpl::get_remaining_ratio() { if (host_ == nullptr) // parallel task: their remain is already between 0 and 1 (see comment in ExecImpl::get_remaining()) - return surf_action_->get_remains(); + return (surf_action_ == nullptr) ? 0 : surf_action_->get_remains(); else // Actually compute the ratio for sequential tasks - return surf_action_->get_remains() / surf_action_->get_cost(); + return (surf_action_ == nullptr) ? 0 : surf_action_->get_remains() / surf_action_->get_cost(); } void simgrid::kernel::activity::ExecImpl::set_bound(double bound) -- 2.20.1