Fix for NPE seen when sometimes trying to clone the next state #1387
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses Pattern 1 as reported in #1380. It makes sure that this issue should not happen, but there is still a likely underlying issue in Synthea. Whether it is worth addressing is up for debate.
The NPE in the bug report happens when the person in the simulation is going through the AVRr Referral submodule in the Myocardial Infarction module. When looking at the debugger for the case in question,
Module
is on the statePriority_4_Next_Encounter_2
and trying to transition to the stateValve Surgery
. However,Module
is in the context of the CABG Referral submodule. When it tries to find theValve Surgery
state, it isn't there.This is likely due to both the CABG and AVRr submodules being called
referral
. This PR renames them so that they both have unique names. There is likely a better fix that would ensure that these two submodules don't conflict, but I was unable to pinpoint where that fix would go and this is an obvious solution that is easily implemented.