Skip to content

Commit

Permalink
8288854: getLocalGraphicsEnvironment() on for multi-screen setups thr…
Browse files Browse the repository at this point in the history
…ows exception NPE

Reviewed-by: azvegint, aivanov
  • Loading branch information
mrserb committed Jul 2, 2022
1 parent 9925014 commit cfc9a88
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ private synchronized void initDevices() {
throw new AWTError("no screen devices");
}
int index = getDefaultScreenNum();
mainScreen = 0 < index && index < screens.length ? index : 0;
mainScreen = 0 < index && index < numScreens ? index : 0;

for (int id = 0; id < numScreens; ++id) {
devices.put(id, old.containsKey(id) ? old.remove(id) :
Expand Down

0 comments on commit cfc9a88

Please sign in to comment.