Buggy code:
public class TableController implements ListSelectionListener , FocusOwner { private TableView headerTable ; private HeaderTableModel headerTableModel ; private SwingWorker worker ; private Folder folder ; private HeaderList headerList ; private FilterToolbar filterToolbar ; private MessageNode [ ] messageNodes ; private MessageNode node ; private MessageNode oldNode ; private Object [ ] selection ; private HeaderTableMouseListener headerTableMouseListener ; private HeaderTableDnd headerTableDnd ; private FilterActionListener filterActionListener ; private TableItem headerTableItem ; private boolean folderChanged = false ; private int counter = 1 ; protected TableView view ; protected AbstractMailFrameController mailFrameController ; protected Object [ ] newUidList ; protected MarkAsReadTimer markAsReadTimer ; protected TableMenu menu ; protected TableModelFilter tableModelFilteredView ; protected TableModelSorter tableModelSorter ; protected TableModelThreadedView tableModelThreadedView ; protected TableModelUpdateManager updateManager ; public TableController ( AbstractMailFrameController mailFrameController ) { } public TableView getView ( ) { } public FilterToolbar getFilterToolbar ( ) { } public TableItem getHeaderTableItem ( ) { } public void saveColumnConfig ( ) { } public HeaderTableModel getHeaderTableModel ( ) { } public FilterActionListener getFilterActionListener ( ) { } public void setSelected ( Object [ ] uids ) { } public void createPopupMenu ( ) { } public JPopupMenu getPopupMenu ( ) { } public void tableChanged ( TableModelChangedEvent event ) throws Exception { if ( MainInterface . DEBUG ) { log . info ( ( "event=" + event ) ) ; } FolderTreeNode folder = event . getSrcFolder ( ) ; if ( folder == null ) { if ( ( event . getEventType ( ) ) == ( TableModelChangedEvent . UPDATE ) ) getHeaderTableModel ( ) . update ( ) ; return ; } FolderCommandReference [ ] r = ( ( FolderCommandReference [ ] ) ( mailFrameController . getSelectionManager ( ) . getSelection ( "mail.table" ) ) ) ; Folder srcFolder = ( ( Folder ) ( r [ 0 ] . getFolder ( ) ) ) ; if ( ( getMailFrameController ( ) ) instanceof ThreePaneMailFrameController ) { if ( srcFolder != null ) ( ( ThreePaneMailFrameController ) ( getMailFrameController ( ) ) ) . treeController . getView ( ) . makeVisible ( srcFolder . getSelectionTreePath ( ) ) ; } if ( ! ( folder . equals ( srcFolder ) ) ) return ; switch ( event . getEventType ( ) ) { case TableModelChangedEvent . SET : { updateManager . set ( event . getHeaderList ( ) ) ; break ; } case TableModelChangedEvent . UPDATE : { updateManager . update ( ) ; break ; } case TableModelChangedEvent . REMOVE : { updateManager . remove ( event . getUids ( ) ) ; break ; } case TableModelChangedEvent . MARK : { updateManager . modify ( event . getUids ( ) ) ; try { log . debug ( "tableChangedEvent.Mark" ) ; Object [ ] lastSelUids = new Object [ 1 ] ; lastSelUids [ 0 ] = ( ( Folder ) ( folder ) ) . getLastSelection ( ) ; <START_BUG> if ( lastSelUids == null ) <END_BUG> break ; setSelected ( lastSelUids ) ; int selRow = getView ( ) . getSelectedRow ( ) ; getView ( ) . scrollRectToVisible ( getView ( ) . getCellRect ( selRow , 0 , false ) ) ; getView ( ) . requestFocus ( ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } break ; } } if ( ( getMailFrameController ( ) ) instanceof ThreePaneMailFrameController ) { ( ( ThreePaneMailFrameController ) ( getMailFrameController ( ) ) ) . folderInfoPanel . setFolder ( srcFolder ) ; } } public AbstractMailFrameController getMailFrameController ( ) { } public MarkAsReadTimer getMarkAsReadTimer ( ) { } public void showHeaderList ( Folder folder , HeaderList headerList ) throws Exception { } public TableModelSorter getTableModelSorter ( ) { } public TableModelThreadedView getTableModelThreadedView ( ) { } public TableModelFilter getTableModelFilteredView ( ) { } public TableModelUpdateManager getUpdateManager ( ) { } public void copy ( ) { } public void cut ( ) { } public void delete ( ) { } public JComponent getComponent ( ) { } public boolean isCopyActionEnabled ( ) { } public boolean isCutActionEnabled ( ) { } public boolean isDeleteActionEnabled ( ) { } public boolean isPasteActionEnabled ( ) { } public boolean isRedoActionEnabled ( ) { } public boolean isSelectAllActionEnabled ( ) { } public boolean isUndoActionEnabled ( ) { } public void paste ( ) { } public void redo ( ) { } public void selectAll ( ) { } public void undo ( ) { } public void valueChanged ( ListSelectionEvent arg0 ) { } }

Fix:
if ( ( lastSelUids [ 0 ] ) == null )