Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS] Possible NPE in Menu._setVisible #922

Closed
tmssngr opened this issue Nov 30, 2023 · 2 comments · Fixed by #923
Closed

[macOS] Possible NPE in Menu._setVisible #922

tmssngr opened this issue Nov 30, 2023 · 2 comments · Fixed by #923

Comments

@tmssngr
Copy link
Contributor

tmssngr commented Nov 30, 2023

Describe the bug
SmartGit users report following exception:

java.lang.NullPointerException
	at org.eclipse.swt.widgets.Menu._setVisible(SourceFile:271)
	at org.eclipse.swt.widgets.Display.runPopups(SourceFile:4490)
	at org.eclipse.swt.widgets.Display.readAndDispatch(SourceFile:3982)
...

It is following code:

		// Hold on to window in case it is disposed while the popup is open.
		window.retain();
		// NSMenu processes events on its own while the popup is open.
		display.sendPreExternalEventDispatchEvent ();
		NSEvent nsEvent = NSEvent.otherEventWithType(OS.NSApplicationDefined, location, 0, 0.0, window.windowNumber(), window.graphicsContext(), (short)0, 0, 0);
		NSMenu.popUpContextMenu(nsMenu, nsEvent, shell.view);
		display.sendPostExternalEventDispatchEvent (); // << here NPE
		window.release();

To Reproduce
Not reproducible reliably.

Expected behavior
No exception.

Screenshots

Environment:

  1. Select the platform(s) on which the behavior is seen:
    • All OS
    • Windows
    • Linux
    • macOS
tmssngr pushed a commit to syntevo/eclipse.platform.swt that referenced this issue Nov 30, 2023
@tmssngr tmssngr changed the title Possible NPE in Menu._setVisible [macOS] Possible NPE in Menu._setVisible Nov 30, 2023
tmssngr pushed a commit to syntevo/eclipse.platform.swt that referenced this issue Dec 27, 2023
@tmssngr
Copy link
Contributor Author

tmssngr commented Jan 2, 2024

Can someone please review my PR?

merks pushed a commit that referenced this issue Jan 3, 2024
@mickaelistria mickaelistria linked a pull request Jan 8, 2024 that will close this issue
@mickaelistria
Copy link
Contributor

Closed with #923

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants