Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCurtis Windatt2009-05-26 16:50:48 -0400
committerCurtis Windatt2009-05-26 16:50:48 -0400
commit02a9bc0935c165e8bf9dcea5ca049aaa8fd9765a (patch)
treed90524653c712f4a4559521edec5874b54af20c8
parent954790ae53e6900596b124077185a1c22eb31672 (diff)
downloadeclipse.platform.debug-02a9bc0935c165e8bf9dcea5ca049aaa8fd9765a.tar.gz
eclipse.platform.debug-02a9bc0935c165e8bf9dcea5ca049aaa8fd9765a.tar.xz
eclipse.platform.debug-02a9bc0935c165e8bf9dcea5ca049aaa8fd9765a.zip
Bug 277869: NPE copying empty list of variables
https://bugs.eclipse.org/bugs/show_bug.cgi?id=277869
-rw-r--r--org.eclipse.debug.core/buildnotes_platform-debug.html4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java24
2 files changed, 17 insertions, 11 deletions
diff --git a/org.eclipse.debug.core/buildnotes_platform-debug.html b/org.eclipse.debug.core/buildnotes_platform-debug.html
index 22591097b..6eb664edd 100644
--- a/org.eclipse.debug.core/buildnotes_platform-debug.html
+++ b/org.eclipse.debug.core/buildnotes_platform-debug.html
@@ -107,6 +107,10 @@ view which were defined in an internal interface. This change moves these const
<p><strong>Action required:</strong> Clients which may have copied these constants or (gasp!) have referenced the internal interface,
should instead reference the new API constants.</p>
+<h2>May 26, 2009</h2>
+<h3>Problem Reports Fixed</h3>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=277869">Bug 277869</a>: NPE copying empty list of variables<br>
+
<h2>May 25, 2009</h2>
<h3>Problem Reports Fixed</h3>
<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=76481">Bug 76481</a>: [doc] In the doc for org.eclipse.debug.ui.AbstractLaunchConfigurationTab, setDirty is badly described<br>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java
index 948d95ca9..625a26fd6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java
@@ -153,19 +153,21 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
}
}
}
- StringBuffer buffer = new StringBuffer();
VirtualElement[] children = modelRoot.getChildren();
- for (int i = 0; i < children.length; i++) {
- if (children[i] != null) {
- copy(children[i], buffer, 0);
+ if (children != null) {
+ StringBuffer buffer = new StringBuffer();
+ for (int i = 0; i < children.length; i++) {
+ if (children[i] != null) {
+ copy(children[i], buffer, 0);
+ }
+ }
+ TextTransfer plainTextTransfer = TextTransfer.getInstance();
+ Clipboard clipboard= new Clipboard(fViewer.getControl().getDisplay());
+ try {
+ doCopy(clipboard, plainTextTransfer, buffer);
+ } finally {
+ clipboard.dispose();
}
- }
- TextTransfer plainTextTransfer = TextTransfer.getInstance();
- Clipboard clipboard= new Clipboard(fViewer.getControl().getDisplay());
- try {
- doCopy(clipboard, plainTextTransfer, buffer);
- } finally {
- clipboard.dispose();
}
}

Back to the top