Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2011-05-09 18:20:38 +0000
committerPawel Piech2011-05-09 18:20:38 +0000
commit0499b208b0797f87759f907aad931d4b9a7a8c60 (patch)
tree5a71619369fd2a96794b789c91e81c60c043c029
parent01b4cc91a8780c82ca183531b4099656fc939325 (diff)
downloadeclipse.platform.debug-0499b208b0797f87759f907aad931d4b9a7a8c60.tar.gz
eclipse.platform.debug-0499b208b0797f87759f907aad931d4b9a7a8c60.tar.xz
eclipse.platform.debug-0499b208b0797f87759f907aad931d4b9a7a8c60.zip
Bug 340750 - [breadcrumb]NPE in LaunchView CopyToClipboard action after activating breadcrumb
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java
index 424c88b06..bcd222e33 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java
@@ -15,7 +15,6 @@ import org.eclipse.debug.internal.ui.viewers.model.VirtualCopyToClipboardActionD
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swt.widgets.Widget;
@@ -30,10 +29,11 @@ public class LaunchViewCopyToClipboardActionDelegate extends VirtualCopyToClipbo
if (view.isBreadcrumbVisible()) {
ISelection selection = getSelection();
if (selection instanceof ITreeSelection && getViewer() instanceof InternalTreeModelViewer) {
- if (selection.isEmpty()) {
- selection = new TreeSelection(TreePath.EMPTY);
+ TreePath path = TreePath.EMPTY;
+ if (!selection.isEmpty()) {
+ path = ((ITreeSelection)selection).getPaths()[0];
}
- return getSelectedItems((InternalTreeModelViewer)getViewer(), ((ITreeSelection)selection).getPaths()[0]);
+ return getSelectedItems((InternalTreeModelViewer)getViewer(), path);
}
return new TreeItem[0];
} else {

Back to the top