Resolves issue with array out of bounds exception on shutdown while

removing tuners from the tuner model.
This commit is contained in:
Denny
2018-07-20 05:59:00 -04:00
parent 61ae0d2d83
commit 5c0d97d942

View File

@@ -85,11 +85,14 @@ public class TunerViewPanel extends JPanel
if(!event.getValueIsAdjusting()) if(!event.getValueIsAdjusting())
{ {
int row = mTunerTable.getSelectedRow(); int row = mTunerTable.getSelectedRow();
int modelRow = mTunerTable.convertRowIndexToModel(row);
if(row >= 0)
{
int modelRow = mTunerTable.convertRowIndexToModel(row);
mTunerEditor.setItem(mTunerModel.getTuner(modelRow)); mTunerEditor.setItem(mTunerModel.getTuner(modelRow));
} }
} }
}
}); });
mTunerModel.addListener(new Listener<TunerEvent>() mTunerModel.addListener(new Listener<TunerEvent>()