mirror of
https://github.com/angryip/ipscan.git
synced 2025-10-26 11:18:17 +00:00
bugfix: do not crash if clicking Rename with nothing selected
This commit is contained in:
parent
896f534029
commit
32d41f0c1c
@ -96,7 +96,9 @@ public class EditFavoritesDialog extends AbstractModalDialog {
|
||||
|
||||
class RenameListener implements Listener {
|
||||
public void handleEvent(Event event) {
|
||||
int index = favoritesList.getSelectionIndex();
|
||||
if (favoritesConfig.size() == 0) return;
|
||||
int index = Math.max(favoritesList.getSelectionIndex(), 0);
|
||||
|
||||
InputDialog prompt = new InputDialog(Labels.getLabel("title.rename"), "");
|
||||
String oldName = favoritesList.getItem(index);
|
||||
String newName = prompt.open(oldName);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user