A fix for a theoretical NPE because a method might return null and it is used.
--------- - [x] I confirm that I make this contribution in accordance with the [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). ------------- Commit messages: - 8385017 Changes: https://git.openjdk.org/jdk/pull/31299/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=31299&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8385017 Stats: 6 lines in 1 file changed: 5 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/31299.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/31299/head:pull/31299 PR: https://git.openjdk.org/jdk/pull/31299
