mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 17:10:27 +00:00
Fix NPE if no terminal was set
This commit is contained in:
parent
6c9fddebe6
commit
fcba5d1c54
1 changed files with 7 additions and 5 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue