aboutsummaryrefslogtreecommitdiff
path: root/src/GetSymmetry.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/GetSymmetry.c')
-rw-r--r--src/GetSymmetry.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/GetSymmetry.c b/src/GetSymmetry.c
index f21a3ee..5224a96 100644
--- a/src/GetSymmetry.c
+++ b/src/GetSymmetry.c
@@ -57,6 +57,13 @@ int GetCartSymVI(const cGH *GH, int *sym, int vi)
DECLARE_CCTK_PARAMETERS
+ if (vi < 0 || vi >= CCTK_NumVars ())
+ {
+ CCTK_VWarn(1,__LINE__,__FILE__,CCTK_THORNSTRING,
+ "Invalid variable index %d in GetCartSymVI", vi);
+ return(-1);
+ }
+
/* Pointer to the SymmetryGHextension */
sGHex = (SymmetryGHex *)CCTK_GHExtension(GH, "Symmetry");