Skip to content

Commit 1eed04d

Browse files
committed
ST6RI-850 Added protective null pointer check in TransitionUsageAdapter.
Checks if TransitionUsage succession is null before creating an implicit binding connector to it. A TransitionUsage should always have a nested succession, but this avoids an NPE if the usage is ill-formed.
1 parent d0dad29 commit 1eed04d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

org.omg.sysml/src/org/omg/sysml/adapter/TransitionUsageAdapter.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,12 @@ protected Feature computeTransitionLinkConnectors() {
9494
Feature transitionLinkFeature = UsageUtil.getTransitionLinkFeatureOf(transition);
9595
if (transitionLinkFeature == null) {
9696
// checkTransitionUsageSuccessionBindingConnector
97-
transitionLinkFeature = SysMLFactory.eINSTANCE.createReferenceUsage();
98-
TypeUtil.addOwnedFeatureTo(transition, transitionLinkFeature);
9997
Succession succession = transition.getSuccession();
100-
addBindingConnector(succession, transitionLinkFeature);
98+
if (succession != null) {
99+
transitionLinkFeature = SysMLFactory.eINSTANCE.createReferenceUsage();
100+
TypeUtil.addOwnedFeatureTo(transition, transitionLinkFeature);
101+
addBindingConnector(succession, transitionLinkFeature);
102+
}
101103

102104
// checkTransitionUsageSourceBindingConnector
103105
List<Feature> parameters = TypeUtil.getOwnedParametersOf(transition);

0 commit comments

Comments
 (0)