This adds a null check in case SwingUtilities.getWindowAncestor is null.

Although I developed a jtreg test in the original ticket write-up for 8382396, 
I later realized I can just ask the preexisting test for JDK-8170794 to run 
with different VM options to help test this issue.

---------
- [x] I confirm that I make this contribution in accordance with the [OpenJDK 
Interim AI Policy](https://openjdk.org/legal/ai).

-------------

Commit messages:
 - 8382396: fixing /othervm usage
 - 8382396: use null-check in case window ancestor is null

Changes: https://git.openjdk.org/jdk/pull/30783/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=30783&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8382396
  Stats: 5 lines in 2 files changed: 1 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/30783.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/30783/head:pull/30783

PR: https://git.openjdk.org/jdk/pull/30783

Reply via email to