TableHeader: fixed NPE for the (unusual) case that JTableHeader is used without JTable

This commit is contained in:
Karl Tauber
2020-08-13 17:07:44 +02:00
parent e29eca203c
commit fd37339e2f

View File

@@ -158,7 +158,7 @@ public class FlatTableHeaderUI
g2.setColor( separatorColor );
int sepCount = columnCount;
if( header.getTable().getAutoResizeMode() != JTable.AUTO_RESIZE_OFF && !isVerticalScrollBarVisible() )
if( header.getTable() != null && header.getTable().getAutoResizeMode() != JTable.AUTO_RESIZE_OFF && !isVerticalScrollBarVisible() )
sepCount--;
if( header.getComponentOrientation().isLeftToRight() ) {