From 3c8e294fd35563abbf53316d100d9f900e2b5b5a Mon Sep 17 00:00:00 2001 From: Darth Vader Date: Fri, 6 Dec 2024 16:49:25 +0000 Subject: [PATCH] Squashed 'phreeqcpp/' changes from c369020..b948e30 b948e30 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: phreeqcpp 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)