From 5d98135f0439b134593838711de7b007a065e55f Mon Sep 17 00:00:00 2001 From: David Parkhurst Date: Mon, 2 Dec 2024 11:28:47 -0700 Subject: [PATCH] Exception caught in PhreeqcI. Null pointer for bad definition in SURFACE_MASTER_SPECIES. Test case surf_error added, which catches the error, but run exits. --- src/tidy.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/tidy.cpp b/src/tidy.cpp index 9449e350..c6dc3ebf 100644 --- a/src/tidy.cpp +++ b/src/tidy.cpp @@ -2312,6 +2312,15 @@ tidy_species(void) } /* store sequence number in master structure */ master[i]->number = i; + if (master[i]->s == NULL) + { + input_error++; + error_string = sformatf( + "Species pointer is null for, %s. Check your _MASTER_ and _SPECIES definitions.", + master[i]->elt->name); + error_msg(error_string, STOP); + } + if (strcmp(master[i]->elt->name, "Alkalinity") != 0) { if (master[i]->primary == TRUE)