mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
safer iteration over list elements
This commit is contained in:
parent
6dd655941d
commit
1370a2db98
@ -523,10 +523,11 @@ public final class KeywordSearchListImportExportTopComponent extends TopComponen
|
|||||||
TableEntry entry = null;
|
TableEntry entry = null;
|
||||||
//iterate until row
|
//iterate until row
|
||||||
Iterator<TableEntry> it = listData.iterator();
|
Iterator<TableEntry> it = listData.iterator();
|
||||||
for (int i = 0; i <= rowIndex; ++i) {
|
for (int i = 0; i <= rowIndex && it.hasNext(); ++i) {
|
||||||
entry = it.next();
|
entry = it.next();
|
||||||
}
|
}
|
||||||
entry.isActive = (Boolean) aValue;
|
if (entry != null)
|
||||||
|
entry.isActive = (Boolean) aValue;
|
||||||
|
|
||||||
initButtons();
|
initButtons();
|
||||||
}
|
}
|
||||||
|
@ -836,10 +836,11 @@ public final class KeywordSearchListTopComponent extends TopComponent implements
|
|||||||
TableEntry entry = null;
|
TableEntry entry = null;
|
||||||
//iterate until row
|
//iterate until row
|
||||||
Iterator<TableEntry> it = keywordData.iterator();
|
Iterator<TableEntry> it = keywordData.iterator();
|
||||||
for (int i = 0; i <= rowIndex; ++i) {
|
for (int i = 0; i <= rowIndex && it.hasNext(); ++i) {
|
||||||
entry = it.next();
|
entry = it.next();
|
||||||
}
|
}
|
||||||
entry.isActive = (Boolean) aValue;
|
if (entry != null)
|
||||||
|
entry.isActive = (Boolean) aValue;
|
||||||
if (getSelectedKeywords().isEmpty()) {
|
if (getSelectedKeywords().isEmpty()) {
|
||||||
deleteWordButton.setEnabled(false);
|
deleteWordButton.setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user