Skip to content

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

Merged
mgaffigan merged 1 commit into
OpenIntegrationEngine:mainfrom
dowel015:fix/clipboard-image-crash-196
Apr 11, 2026
Merged

fix: handle clipboard Error when image is in clipboard (#196)#283
mgaffigan merged 1 commit into
OpenIntegrationEngine:mainfrom
dowel015:fix/clipboard-image-crash-196

Conversation

@dowel015

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

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.

@tonygermanotonygermano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for your contribution! I get bit by this every once in a while. Tested, and it works for me.

@mgaffigan
mgaffigan requested review from a team, NicoPiel, gibson9583, jonbartels, kayyagari, pacmano1 and ssrowe and removed request for a teamApril 11, 2026 21:38
…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>
@mgaffigan
mgaffiganforce-pushed the fix/clipboard-image-crash-196 branch from f09926c to 6b18572CompareApril 11, 2026 23:23
@mgaffigan
mgaffigan merged commit 5203b3a into OpenIntegrationEngine:mainApr 11, 2026
1 check passed
Sign up for freeto 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

4 participants

@dowel015@mgaffigan@NicoPiel@tonygermano