Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlain Magloire2003-12-18 16:50:55 -0500
committerAlain Magloire2003-12-18 16:50:55 -0500
commit4822f014f19970a71abf7ae0cf7277947eb6aeb4 (patch)
tree3e98048d8a8ead5b05b35d95597afb731fa61e12
parentcdbbcc88c75106d72a68834af7ffe077eca89642 (diff)
downloadorg.eclipse.cdt-4822f014f19970a71abf7ae0cf7277947eb6aeb4.tar.gz
org.eclipse.cdt-4822f014f19970a71abf7ae0cf7277947eb6aeb4.tar.xz
org.eclipse.cdt-4822f014f19970a71abf7ae0cf7277947eb6aeb4.zip
Fix Pr 49146, Possible NPE
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java
index 07e7926fa33..d8566c627f8 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java
@@ -290,13 +290,15 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut {
for (int i = 0; i < nElements; i++) {
if (elements[i] instanceof IAdaptable) {
IResource r = (IResource) ((IAdaptable) elements[i]).getAdapter(IResource.class);
- ICProject cproject = CoreModel.getDefault().create(r.getProject());
- if (cproject != null) {
- IBinary[] bins = cproject.getBinaryContainer().getBinaries();
+ if (r != null) {
+ ICProject cproject = CoreModel.getDefault().create(r.getProject());
+ if (cproject != null) {
+ IBinary[] bins = cproject.getBinaryContainer().getBinaries();
- for (int j = 0; j < bins.length; j++) {
- if (bins[j].isExecutable()) {
- results.add(bins[j]);
+ for (int j = 0; j < bins.length; j++) {
+ if (bins[j].isExecutable()) {
+ results.add(bins[j]);
+ }
}
}
}

Back to the top