Skip to content

Commit

Permalink
Handle not set workspace target in TargetDefinitionActivationCodeMining
Browse files Browse the repository at this point in the history
  • Loading branch information
HannesWell committed Oct 16, 2024
1 parent e88c916 commit 7be24be
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2018, 2019 vogella GmbH and others
* Copyright (c) 2018, 2024 vogella GmbH and others
*
* 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 @@ -67,11 +67,10 @@ protected CompletableFuture<Void> doResolve(ITextViewer viewer, IProgressMonitor
}
boolean isCurrent = false;
try {
ITargetPlatformService service = acquireTargetPlatformService();
String memento = service.getWorkspaceTargetHandle().getMemento();
ITargetHandle targetHandle = getTargetHandle();
String targetMemento = targetHandle.getMemento();
isCurrent = Objects.equals(memento, targetMemento);
ITargetHandle workspaceTarget = acquireTargetPlatformService().getWorkspaceTargetHandle();
if (workspaceTarget != null) {
isCurrent = Objects.equals(workspaceTarget.getMemento(), getTargetHandle().getMemento());
}
} catch (CoreException e) {
// Caught with default message shown
}
Expand Down

0 comments on commit 7be24be

Please sign in to comment.