summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java4
1 files changed, 3 insertions, 1 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 c9787ecac3..986854b142 100755
--- 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
@@ -864,7 +864,9 @@ public Point getSize () {
if (count == 0) return new Point (0, 0);
RECT rect = new RECT ();
int hwndParent = parent.handle;
- OS.GetMenuItemRect (hwndParent, handle, count - 1, rect);
+ if (!OS.GetMenuItemRect (hwndParent, handle, count - 1, rect)) {
+ return new Point (0, 0);
+ }
int width = rect.right + 4;
int height = rect.bottom + 4;
return new Point (width, height);