Skip to content

Commit c54bca6

Browse files
author
Harshitha Onkar
committedJan 12, 2024
8323617: Add missing null checks to GetMousePositionWithPopup.java test
Reviewed-by: serb, aivanov, dnguyen
1 parent 95a9168 commit c54bca6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed
 

‎test/jdk/java/awt/Mouse/GetMousePositionTest/GetMousePositionWithPopup.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -94,9 +94,13 @@ public static void main(String[] args) throws Exception {
9494
robot.mouseMove(MOUSE_POS3, MOUSE_POS3);
9595
syncLocationToWindowManager();
9696
} finally {
97-
SwingUtilities.invokeLater(() -> {
98-
frame1.dispose();
99-
frame2.dispose();
97+
SwingUtilities.invokeAndWait(() -> {
98+
if (frame1 != null) {
99+
frame1.dispose();
100+
}
101+
if (frame2 != null) {
102+
frame2.dispose();
103+
}
100104
});
101105
}
102106
}

0 commit comments

Comments
 (0)
Please sign in to comment.