瀏覽代碼

Merge branch 'master' of https://github.com/Yakindu/statecharts.git

Andreas Muelder 9 年之前
父節點
當前提交
1059680a0d

+ 2 - 1
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/validation/SCTResourceValidator.java

@@ -46,7 +46,8 @@ public class SCTResourceValidator extends AbstractDeclarativeValidator {
 		for (Map.Entry<SpecificationElement, Collection<Diagnostic>> entry : resource.getLinkingDiagnostics().asMap()
 				.entrySet()) {
 			for (Diagnostic diag : entry.getValue()) {
-				error(diag.getMessage(), entry.getKey(), null, -1);
+				if (entry.getKey().eResource() != null)
+					error(diag.getMessage(), entry.getKey(), null, -1);
 			}
 		}
 	}

+ 1 - 1
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/edithelper/RegionEditHelper.java

@@ -35,7 +35,7 @@ public class RegionEditHelper extends AbstractEditHelper {
 		return new DestroyElementCommand(req) {
 			@Override
 			protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-				if (getElementToDestroy() instanceof State) {
+				if (getElementToDestroy() instanceof State && getElementToDestroy().eResource() != null) {
 					boolean success = DiagramPartitioningUtil.closeSubdiagramEditors((State) getElementToDestroy());
 					if (success)
 						return super.doExecute(monitor, info);