diff options
author | eschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2013-01-20 03:44:11 +0000 |
---|---|---|
committer | eschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2013-01-20 03:44:11 +0000 |
commit | a8897d886ac87d3dddcaa565a07959289df3d0bc (patch) | |
tree | be64556add99b0adf8496a0322c02498b41370c4 /src | |
parent | cbb5ceaeb8b507b6b9469bd8609c954411c94cd6 (diff) |
Add more error checks when activating thorns
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4945 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src')
-rw-r--r-- | src/main/ActiveThorns.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/ActiveThorns.c b/src/main/ActiveThorns.c index 7a4afccd..a7b0730c 100644 --- a/src/main/ActiveThorns.c +++ b/src/main/ActiveThorns.c @@ -960,18 +960,25 @@ int CCTKi_ActivateThorns(const char *activethornlist) thorn = Util_StringListNext(activated_thorns,0)) { this_thorn = ((t_sktree *) SKTreeFindNode(thornlist, thorn))->data; - if(this_thorn->activates_thorns) + if(this_thorn && this_thorn->activates_thorns) { for(i = 0; this_thorn->activates_thorns[i]; i++) { new_thorn = this_thorn->activates_thorns[i]; if (! CCTK_IsThornActive(new_thorn)) { - if (Util_StringListAdd(new_thorns, new_thorn)) + switch (Util_StringListAdd(new_thorns, new_thorn)) { + case 0: + /* Thorn already scheduled for activation */ + break; + case 1: printf("Thorn %s requests automatic activation of %s\n", thorn, new_thorn); did_add_thorns = 1; + break; + default: + CCTK_Warn(0, __LINE__, __FILE__, "Cactus", "Internal error"); } } } |