This commit is contained in:
crschnick 2024-08-31 08:21:56 +00:00
parent b8a981eb1f
commit c7d38843da

View file

@ -44,11 +44,11 @@ public class ShellDialects {
} }
public static boolean isPowershell(ShellControl sc) { public static boolean isPowershell(ShellControl sc) {
return sc.getShellDialect().equals(POWERSHELL) || sc.getShellDialect().equals(POWERSHELL_CORE); if (sc.getShellDialect() == null) {
} return false;
}
public static ShellDialect byName(String name) { return sc.getShellDialect().equals(POWERSHELL) || sc.getShellDialect().equals(POWERSHELL_CORE);
return byNameIfPresent(name).orElseThrow();
} }
public static Optional<ShellDialect> byNameIfPresent(String name) { public static Optional<ShellDialect> byNameIfPresent(String name) {