From fd4bca39f078bdf3afadab7ec3bea65869cdf46c Mon Sep 17 00:00:00 2001 From: Maxime Porhel Date: Wed, 24 Apr 2024 11:39:15 +0200 Subject: [PATCH] #2860 Avoid NPE when no descriptor is found Signed-off-by: Maxime Porhel --- .../sirius/ui/navigator/view/AirdDiagramLinkHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.navigator/src/org/polarsys/capella/core/platform/sirius/ui/navigator/view/AirdDiagramLinkHelper.java b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.navigator/src/org/polarsys/capella/core/platform/sirius/ui/navigator/view/AirdDiagramLinkHelper.java index 3a356d12a7..0facf89adf 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.navigator/src/org/polarsys/capella/core/platform/sirius/ui/navigator/view/AirdDiagramLinkHelper.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.navigator/src/org/polarsys/capella/core/platform/sirius/ui/navigator/view/AirdDiagramLinkHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. + * Copyright (c) 2006, 2024 THALES GLOBAL SERVICES. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -108,7 +108,7 @@ public IStructuredSelection findSelection(IEditorInput anInput) { if (element instanceof DRepresentation) { DRepresentationDescriptor descriptor = RepresentationHelper .getRepresentationDescriptor((DRepresentation) element); - return new StructuredSelection(descriptor); + return descriptor == null ? null : new StructuredSelection(descriptor); } } }