File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
gui/src/main/java/net/raphimc/noteblocktool/frames Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -173,8 +173,11 @@ private void addContextMenu() {
173173 contextMenu .addPopupMenuListener (new PopupMenuListener () {
174174 @ Override
175175 public void popupMenuWillBecomeVisible (PopupMenuEvent e ) {
176+ Point mousePosition = contextMenu .getInvoker ().getMousePosition ();
177+ if (mousePosition == null ) return ;
178+
176179 int [] selectedRows = ListFrame .this .table .getSelectedRows ();
177- int hoveredRow = ListFrame .this .table .rowAtPoint (contextMenu . getInvoker (). getMousePosition () );
180+ int hoveredRow = ListFrame .this .table .rowAtPoint (mousePosition );
178181 if (hoveredRow >= 0 && Arrays .stream (selectedRows ).noneMatch (i -> i == hoveredRow )) {
179182 ListFrame .this .table .setRowSelectionInterval (hoveredRow , hoveredRow );
180183 }
You can’t perform that action at this time.
0 commit comments