Fix NPE if no terminal was set

This commit is contained in:
crschnick 2024-01-04 09:11:34 +00:00
parent 6c9fddebe6
commit fcba5d1c54

View file

@ -12,10 +12,6 @@ import java.util.List;
public abstract class MultiExecuteAction implements BranchAction {
protected String filesArgument(List<BrowserEntry> entries) {
return entries.size() == 1 ? entries.get(0).getOptionallyQuotedFileName() : "(" + entries.size() + ")";
}
protected abstract String createCommand(ShellControl sc, OpenFileSystemModel model, BrowserEntry entry);
@Override
@ -37,9 +33,15 @@ public abstract class MultiExecuteAction implements BranchAction {
false);
}
@Override
public boolean isApplicable(OpenFileSystemModel model, List<BrowserEntry> entries) {
return AppPrefs.get().terminalType().getValue() != null;
}
@Override
public String getName(OpenFileSystemModel model, List<BrowserEntry> entries) {
return "in " + AppPrefs.get().terminalType().getValue().toTranslatedString();
var t = AppPrefs.get().terminalType().getValue();
return "in " + (t != null ? t.toTranslatedString() : "?");
}
},
new LeafAction() {