From 80e6575784e593f4f75206f6fdc0e5a5ba996b35 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 30 Nov 2022 08:08:32 -0500 Subject: [PATCH] avoid segfault, if repscale array is not allocated --- src/CG-SPICA/angle_spica.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CG-SPICA/angle_spica.cpp b/src/CG-SPICA/angle_spica.cpp index 83a4fbb4ad..3f8a506ed2 100644 --- a/src/CG-SPICA/angle_spica.cpp +++ b/src/CG-SPICA/angle_spica.cpp @@ -297,7 +297,7 @@ void AngleSPICA::init_style() repflag = 0; for (int i = 1; i <= atom->nangletypes; i++) - if (repscale[i] > 0.0) repflag = 1; + if (repscale && (repscale[i] > 0.0)) repflag = 1; // set up pointers to access SPICA LJ parameters for 1-3 interactions