From 81902db1137b0358ad478c5141ec0fdf3b973930 Mon Sep 17 00:00:00 2001 From: Darth Vader Date: Fri, 6 Dec 2024 16:52:52 +0000 Subject: [PATCH] Squashed 'src/' changes from c369020d..b948e30d b948e30d 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. git-subtree-dir: src git-subtree-split: b948e30d1ef801f52c99736b58e79dcff5537e23 --- tidy.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tidy.cpp b/tidy.cpp index 9449e350..c6dc3ebf 100644 --- a/tidy.cpp +++ b/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)