Skip to content

Commit

Permalink
Add null-check for converting event just to be safe.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bl3nd committed Sep 27, 2024
1 parent bfdab8a commit 4597dbe
Showing 1 changed file with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ private class TabMouseListener extends MouseAdapter
public void mouseClicked(MouseEvent e)
{
e = convert(e);
if (e == null)
return;

Objects.requireNonNull(getHandler()).mouseClicked(e);
}

Expand All @@ -215,46 +218,62 @@ public void mousePressed(MouseEvent e)
}

e = convert(e);
if (e == null)
return;

Objects.requireNonNull(getHandler()).mousePressed(e);
}

@Override
public void mouseEntered(MouseEvent e)
{
e = convert(e);
if (e == null)
return;

Objects.requireNonNull(getHandler()).mouseEntered(e);
}

@Override
public void mouseExited(MouseEvent e)
{
e = convert(e);
if (e == null)
return;

Objects.requireNonNull(getHandler()).mouseExited(e);
}

@Override
public void mouseReleased(MouseEvent e)
{
e = convert(e);
if (e == null)
return;

Objects.requireNonNull(getHandler()).mouseReleased(e);
}

@Override
public void mouseDragged(MouseEvent e)
{
e = convert(e);
if (e == null)
return;

Objects.requireNonNull(getHandler()).mouseDragged(e);
}

@Override
public void mouseMoved(MouseEvent e)
{
e = convert(e);
if (e == null)
return;

Objects.requireNonNull(getHandler()).mouseMoved(e);
}



private MouseEvent convert(MouseEvent e)
{
ScrollableTabPanel tabPanel = getTabPanel();
Expand Down

0 comments on commit 4597dbe

Please sign in to comment.