From 849b1e88db67e2a49d8acb04f71e1951ddc8b02c Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Tue, 6 Aug 2013 12:55:34 -0400 Subject: Carpet: Turn timer calls into no-ops when timer hierarchy does not exist This allows timer calls after the timers have been deallcoated. --- Carpet/Carpet/src/Timers.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Carpet/Carpet/src/Timers.cc b/Carpet/Carpet/src/Timers.cc index 01d502aa3..f783c92de 100644 --- a/Carpet/Carpet/src/Timers.cc +++ b/Carpet/Carpet/src/Timers.cc @@ -59,6 +59,7 @@ namespace Carpet { void Timer::start () { TimerNode *current_timer = d_tree->current; + if (not d_tree->root) return; // do nothing if there is no root assert(current_timer); current_timer->getChildTimer(name())->start(); } @@ -67,6 +68,7 @@ namespace Carpet { void Timer::stop () { TimerNode *current = d_tree->current; + if (not d_tree->root) return; // do nothing if there is no root if (current->getName() != name()) CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING, "Trying to stop enclosing timer '%s' before enclosed time '%s'", -- cgit v1.2.3