Prevent NPE when removing the last Element from the "Connect Replays" list
This commit is contained in:
@@ -128,6 +128,7 @@ public class GuiConnectPart extends GuiStudioPart {
|
|||||||
filesToConcat.set(concatList.getSelectionIndex(), replayDropdown.getElement(selectionIndex));
|
filesToConcat.set(concatList.getSelectionIndex(), replayDropdown.getElement(selectionIndex));
|
||||||
concatList.setElements(filesToConcat);
|
concatList.setElements(filesToConcat);
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
// TODO Prevent exception
|
// TODO Prevent exception
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -136,7 +137,15 @@ public class GuiConnectPart extends GuiStudioPart {
|
|||||||
concatList.addSelectionListener(new SelectionListener() {
|
concatList.addSelectionListener(new SelectionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSelectionChanged(int selectionIndex) {
|
public void onSelectionChanged(int selectionIndex) {
|
||||||
String selName = concatList.getElement(selectionIndex).getDisplayString();
|
GuiEntryListStringEntry entry = concatList.getElement(selectionIndex);
|
||||||
|
if(entry == null) {
|
||||||
|
removeButton.enabled = false;
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
removeButton.enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
String selName = entry.getDisplayString();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(Object s : replayDropdown.getAllElements()) {
|
for(Object s : replayDropdown.getAllElements()) {
|
||||||
String str = ((GuiEntryListStringEntry)s).getDisplayString();
|
String str = ((GuiEntryListStringEntry)s).getDisplayString();
|
||||||
|
|||||||
Reference in New Issue
Block a user