Skip to content

Commit

Permalink
#2860 Avoid NPE when no descriptor is found
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime Porhel <[email protected]>
  • Loading branch information
mPorhel authored and pdulth committed May 21, 2024
1 parent 2a540ef commit fd4bca3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit fd4bca3

Please sign in to comment.