summaryrefslogtreecommitdiff
path: root/src/main/GroupsOnGH.c
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-04-10 22:57:05 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-04-10 22:57:05 +0000
commite11d2ffa08ba79f85dde5aa3418f7d5920037f6b (patch)
treea391081f2704a96871daf4f3e6498fff57627244 /src/main/GroupsOnGH.c
parent578d96eb19e3ad6371a6c9c9ac0beb26345710e0 (diff)
Some error checking
git-svn-id: http://svn.cactuscode.org/flesh/trunk@464 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/GroupsOnGH.c')
-rw-r--r--src/main/GroupsOnGH.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/GroupsOnGH.c b/src/main/GroupsOnGH.c
index e41148a7..f11818d4 100644
--- a/src/main/GroupsOnGH.c
+++ b/src/main/GroupsOnGH.c
@@ -37,7 +37,14 @@ static char *rcsid = "$Header$";
@@*/
void *CCTK_GetVarDataPtr_ByName(cGH *GH, char *fullvarname, int timelevel)
{
- return (GH->data[CCTK_GetVarNum(NULL,NULL,fullvarname)][timelevel]);
+ int index;
+ void *retval=NULL;
+
+ index = CCTK_GetVarNum(NULL,NULL,fullvarname);
+ if (index >= 0)
+ {
+ retval = GH->data[index][timelevel];
+ }
}
/*@@