mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-19 14:55:17 +00:00
7184951: [macosx] Exception at java.awt.datatransfer on headless mode (only in GUI session)
Reviewed-by: art, anthony
This commit is contained in:
parent
54198bc15e
commit
a98d595162
@ -182,7 +182,11 @@ public class CDataTransferer extends DataTransferer {
|
||||
Long format = predefinedClipboardNameMap.get(str);
|
||||
|
||||
if (format == null) {
|
||||
format = new Long(registerFormatWithPasteboard(str));
|
||||
if (java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().isHeadlessInstance()) {
|
||||
// Do not try to access native system for the unknown format
|
||||
return -1L;
|
||||
}
|
||||
format = registerFormatWithPasteboard(str);
|
||||
predefinedClipboardNameMap.put(str, format);
|
||||
predefinedClipboardFormatMap.put(format, str);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user