diff --git a/core/src/main/java/io/xpipe/core/process/ShellDialects.java b/core/src/main/java/io/xpipe/core/process/ShellDialects.java index 68893c8bd..8c82f8de4 100644 --- a/core/src/main/java/io/xpipe/core/process/ShellDialects.java +++ b/core/src/main/java/io/xpipe/core/process/ShellDialects.java @@ -44,11 +44,11 @@ public class ShellDialects { } 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 byNameIfPresent(name).orElseThrow(); + return sc.getShellDialect().equals(POWERSHELL) || sc.getShellDialect().equals(POWERSHELL_CORE); } public static Optional byNameIfPresent(String name) {