aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiraj Modi2014-04-28 07:17:31 (EDT)
committerNiraj Modi2014-04-28 07:17:31 (EDT)
commit2a9647e91a768f63b6d0820bd017a70caebfd276 (patch)
treeb33ace831d1a6c46f54a9e62f64131c33b1b9a84
parent6d76eb1e238bc8b66937e416f952f49c5f28407c (diff)
downloadeclipse.platform.swt-2a9647e91a768f63b6d0820bd017a70caebfd276.zip
eclipse.platform.swt-2a9647e91a768f63b6d0820bd017a70caebfd276.tar.gz
eclipse.platform.swt-2a9647e91a768f63b6d0820bd017a70caebfd276.tar.bz2
Bug 431313 - NullPointerException in swt.widgets.Widget.toString()refs/changes/51/25651/1
Change-Id: Ib5aa45d13f8e8efbf21a325213de01c300f3de5f Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java
index 1462d3c..d1e3662 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -910,10 +910,10 @@ String getNameText () {
MenuItem [] items = getItems ();
int length = items.length;
if (length > 0) {
- for (int i=0; i<length-1; i++) {
- result = result + items [i].getNameText() + ", ";
+ for (int i=0; i<=length-1; i++) {
+ result += (items [i] == null ? "null" : items [i].getNameText())
+ + (i < (length - 1) ? ", " : "");
}
- result = result + items [length-1].getNameText ();
}
return result;
}