aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2013-08-06 12:55:34 -0400
committerErik Schnetter <schnetter@gmail.com>2013-08-06 13:11:11 -0400
commit849b1e88db67e2a49d8acb04f71e1951ddc8b02c (patch)
tree279ab73bad00b71a93ca343585496c609b4de981
parent6a344ba05da78f55de86fc966817cfdba159bc82 (diff)
Carpet: Turn timer calls into no-ops when timer hierarchy does not exist
This allows timer calls after the timers have been deallcoated.
-rw-r--r--Carpet/Carpet/src/Timers.cc2
1 files changed, 2 insertions, 0 deletions
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'",