Skip to content

fix: handle clipboard Error when image is in clipboard (#196)#283

Open
dowel015 wants to merge 1 commit intoOpenIntegrationEngine:mainfrom
dowel015:fix/clipboard-image-crash-196
Open

fix: handle clipboard Error when image is in clipboard (#196)#283
dowel015 wants to merge 1 commit intoOpenIntegrationEngine:mainfrom
dowel015:fix/clipboard-image-crash-196

Conversation

@dowel015
Copy link
Copy Markdown

@dowel015 dowel015 commented Apr 2, 2026

Summary

  • PasteAction.isEnabled() calls clipboard.getContents() to check for pasteable content, which triggers JAI's PNMImageWriter initialization on Linux
  • PNMImageWriter attempts to access sun.security.action.GetPropertyAction, a sealed internal JDK class, throwing IllegalAccessError under Java 17
  • The existing catch only handled IllegalStateException, so the Error propagated up and crashed the Admin UI on login
  • Added a catch (Error e) block that logs a warning and returns false, keeping the paste action disabled without crashing

Fixes #196

Test plan

  • Copy an image to clipboard (e.g. right-click → Copy Image in a browser)
  • Launch OIE Admin
  • Verify login succeeds and no crash occurs
  • Verify paste still works normally when text is on the clipboard

…onEngine#196)

Catch Error (e.g. IllegalAccessError from JAI's PNMImageWriter) thrown
during clipboard inspection in PasteAction.isEnabled(), log a warning,
and return false instead of crashing the Admin UI on login.

Signed-off-by: Joshua Dowell <joshua.dowell@centrallogic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

Test Results

  111 files  ±0    214 suites  ±0   7m 0s ⏱️ + 1m 8s
  654 tests ±0    654 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 308 runs  ±0  1 308 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit f09926c. ± Comparison against base commit be1072d.

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 this pull request may close these issues.

[BUG] Administrator UI crashes when the latest element on clipboard is an image

2 participants