mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 06:12:05 +01:00
[core] Check if the successor vertex exists in StateDescriptorGraph
If the successor's module is disabled then the vertex may be null. In this case, we can simple continue with the next successor in the list. Previously, due tod33a5a23c3
("[core] Introduce Builder.failOnUnknownStates() and unit tests") this would trigger an assert in addOutgoingEdge(). Fixes:d33a5a23c3
("[core] Introduce Builder.failOnUnknownStates() and unit tests")
This commit is contained in:
parent
a0b9279441
commit
32a38c4e77
1 changed files with 4 additions and 0 deletions
|
@ -186,6 +186,10 @@ public class StateDescriptorGraph {
|
||||||
|
|
||||||
for (GraphVertex<Class<? extends StateDescriptor>> successor : sortedSuccessors) {
|
for (GraphVertex<Class<? extends StateDescriptor>> successor : sortedSuccessors) {
|
||||||
GraphVertex<StateDescriptor> successorVertex = successorStateDescriptors.get(successor.element);
|
GraphVertex<StateDescriptor> successorVertex = successorStateDescriptors.get(successor.element);
|
||||||
|
if (successorVertex == null) {
|
||||||
|
// The successor does not exist, probably because its module was not enabled.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
node.addOutgoingEdge(successorVertex);
|
node.addOutgoingEdge(successorVertex);
|
||||||
|
|
||||||
// Recurse further.
|
// Recurse further.
|
||||||
|
|
Loading…
Reference in a new issue