Skip to content

Commit 394156e

Browse files
committed
ST6RI-914 Added checks to KerMLLibraryProvider::getElement.
- Check if name is null, to avoid exception from toQualifiedName. - Check if context resourceSet is null, to avoid exception from getResourceDescription.
1 parent c094853 commit 394156e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

org.omg.kerml.xtext/src/org/omg/kerml/xtext/library/KerMLLibraryProvider.xtend

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
* SysML 2 Pilot Implementation
3-
* Copyright (c) 2019-2020 Model Driven Solutions, Inc.
3+
* Copyright (c) 2019-2020, 2026 Model Driven Solutions, Inc.
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU Lesser General Public License as published by
@@ -44,7 +44,7 @@ class KerMLLibraryProvider implements IModelLibraryProvider {
4444
ResourceDescriptionsProvider resourceDescriptionProvider
4545

4646
override Element getElement(Element context, String name) {
47-
if (context === null) {
47+
if (context?.eResource()?.getResourceSet() === null || name === null) {
4848
return null
4949
} else {
5050
val qname = nameConverter.toQualifiedName(name)

0 commit comments

Comments
 (0)