File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
assertj-swing/src/main/java/org/assertj/swing/input Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -109,13 +109,16 @@ public void update(@Nonnull AWTEvent event) {
109109 }
110110 if (inputEvent instanceof MouseEvent ) {
111111 MouseEvent mouseEvent = (MouseEvent ) inputEvent ;
112- Point eventScreenLocation = screenLocation (mouseEvent );
113- synchronized (this ) {
114- lastEventTime (mouseEvent );
115- dragDropInfo .update (mouseEvent );
116- mouseInfo .modifiers (modifiers );
117- mouseInfo .update (mouseEvent , eventScreenLocation );
118- modifiers (mouseInfo .modifiers ());
112+ //TrayIcon might post events without a component
113+ if (mouseEvent .getComponent () != null ) {
114+ Point eventScreenLocation = screenLocation (mouseEvent );
115+ synchronized (this ) {
116+ lastEventTime (mouseEvent );
117+ dragDropInfo .update (mouseEvent );
118+ mouseInfo .modifiers (modifiers );
119+ mouseInfo .update (mouseEvent , eventScreenLocation );
120+ modifiers (mouseInfo .modifiers ());
121+ }
119122 }
120123 }
121124 }
You can’t perform that action at this time.
0 commit comments