From cf5c42889d64c3bfb13d8a61e8e834eb10dbc16c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 15 Nov 2024 13:01:23 -0500 Subject: [PATCH] avoid dereferencing reaxff object when no reaxff pair style in use --- src/REAXFF/fix_qeq_reaxff.cpp | 2 +- src/REAXFF/fix_qtpie_reaxff.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/REAXFF/fix_qeq_reaxff.cpp b/src/REAXFF/fix_qeq_reaxff.cpp index 067272f0f7..dc8fbd5afd 100644 --- a/src/REAXFF/fix_qeq_reaxff.cpp +++ b/src/REAXFF/fix_qeq_reaxff.cpp @@ -344,7 +344,7 @@ void FixQEqReaxFF::allocate_matrix() int mincap; double safezone; - if (reaxflag) { + if (reaxflag && reaxff) { mincap = reaxff->api->system->mincap; safezone = reaxff->api->system->safezone; } else { diff --git a/src/REAXFF/fix_qtpie_reaxff.cpp b/src/REAXFF/fix_qtpie_reaxff.cpp index 48c1109178..5acdea0482 100644 --- a/src/REAXFF/fix_qtpie_reaxff.cpp +++ b/src/REAXFF/fix_qtpie_reaxff.cpp @@ -370,7 +370,7 @@ void FixQtpieReaxFF::allocate_matrix() int mincap; double safezone; - if (reaxflag) { + if (reaxflag && reaxff) { mincap = reaxff->api->system->mincap; safezone = reaxff->api->system->safezone; } else {