From 65f9c1abf54f6207ad4313416d6d7f16ec8b786f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 17 Jul 2020 14:00:16 -0400 Subject: [PATCH] bugfix: reorder instructions --- src/variable.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/variable.cpp b/src/variable.cpp index 061c302d8b..880061bae1 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -4221,13 +4221,14 @@ int Variable::special_function(char *word, char *contents, Tree **tree, if (eval_in_progress[ivar]) print_var_error(FLERR,"Variable has circular dependency",ivar); - if ((method == AVE) && (nvec == 0)) - print_var_error(FLERR,"Cannot compute average of empty vector",ivar); - double *vec; nvec = compute_vector(ivar,&vec); nstride = 1; + if ((method == AVE) && (nvec == 0)) + print_var_error(FLERR,"Cannot compute average of empty vector",ivar); + + } else print_var_error(FLERR,"Invalid special function in " "variable formula",ivar);