-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Address 24.2 EMPD Issue #10781
Address 24.2 EMPD Issue #10781
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If CI is clean, this should be fine to drop in and we can start getting 24.2.1 out.
@@ -249,9 +249,9 @@ void GetMoistureBalanceEMPDInput(EnergyPlusData &state) | |||
|
|||
auto const &constr = state.dataConstruction->Construct(surf.Construction); | |||
auto const *mat = dynamic_cast<const MaterialEMPD *>(s_mat->materials(constr.LayerPoint(constr.TotLayers))); | |||
assert(mat != nullptr); | |||
// assert(mat != nullptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way things are structured now, it's totally fine for this to result in a nullptr. If the material doesn't have any EMPD properties, that's fine. So we shouldn't do a hard assertion.
|
||
if (mat->mu > 0.0 && surf.Zone > 0) { | ||
if (mat && mat->mu > 0.0 && surf.Zone > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead, let's just check that mat is real before accessing it. This will properly pass if the inside layer has EMPD stuff. And it will properly result in a warning message if the layer does not have EMPD stuff. This works happily now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, why not not the hasEMPD boolean? isn't what it's for?
Everything is happy here. OK, merging this and tagging v24.2.1-RC1. Sorry about this, and thanks for reporting it, @jmarrec |
Pull request overview
Most of the conversation can be found here, but basically, there was an incorrect check that let an invalid configuration pass before 24.2, accidentally segfaulted in 24.2.0, and now fails gracefully (in 24.2.1+).
I don't expect any diffs or failures, so if there are any, this won't be ready. If it's all green, I think it's good to go.