Skip to content

Fix: handle UnsupportedOperationException in SystemTray to prevent cr…#14637

Open
KartikeyTripathi469 wants to merge 1 commit intomagefree:masterfrom
KartikeyTripathi469:fix/system-tray-unsupported-operation-exception
Open

Fix: handle UnsupportedOperationException in SystemTray to prevent cr…#14637
KartikeyTripathi469 wants to merge 1 commit intomagefree:masterfrom
KartikeyTripathi469:fix/system-tray-unsupported-operation-exception

Conversation

@KartikeyTripathi469
Copy link
Copy Markdown

Description
This PR addresses a crash where SystemTray.isSupported() returns true but SystemTray.getSystemTray() throws an UnsupportedOperationException on certain OS environments.

Changes

Wrapped getSystemTray() in a try-catch block.

Added a log warning and safe return if the tray is unavailable.

Verified the fix with a local build of the Mage.Client module

Copy link
Copy Markdown
Contributor

@xenohedron xenohedron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a related issue this closes? What OS did you reproduce this error on before fixing it?


public void install() {

public void install() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix indentation back to how it was

});

final SystemTray tray = SystemTray.getSystemTray();
// --- YOUR FIX STARTS HERE ---
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for the your fix starts/ends comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants