From e0b9902cbb865ae7a7baa8e4c1f1288ecd5eed31 Mon Sep 17 00:00:00 2001 From: "Daniel R. Roe" Date: Tue, 26 Nov 2024 09:45:07 -0500 Subject: [PATCH] Add error message for when topology is not present - needed for the inmask for loop --- src/ForLoop_mask.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ForLoop_mask.cpp b/src/ForLoop_mask.cpp index ccddb3ec1d..015fb3bccf 100644 --- a/src/ForLoop_mask.cpp +++ b/src/ForLoop_mask.cpp @@ -47,7 +47,10 @@ int ForLoop_mask::SetupFor(CpptrajState& State, ArgList& argIn) { } Topology* top = State.DSL().GetTopByIndex( argIn ); if (top != 0) currentTop_ = top; - if (currentTop_ == 0) return 1; + if (currentTop_ == 0) { + mprinterr("Error: No topology found for mask for loop.\n"); + return 1; + } // Get the variable name if (SetupLoopVar( State.DSL(), argIn.GetStringNext() )) return 1;