diff --git a/termux-shared/src/main/java/com/termux/shared/shell/command/runner/app/AppShell.java b/termux-shared/src/main/java/com/termux/shared/shell/command/runner/app/AppShell.java
index 8eb3b899..ad082392 100644
--- a/termux-shared/src/main/java/com/termux/shared/shell/command/runner/app/AppShell.java
+++ b/termux-shared/src/main/java/com/termux/shared/shell/command/runner/app/AppShell.java
@@ -69,6 +69,13 @@ public final class AppShell {
final AppShellClient appShellClient,
@NonNull final ShellEnvironmentClient shellEnvironmentClient,
final boolean isSynchronous) {
+ if (executionCommand.executable == null || executionCommand.executable.isEmpty()) {
+ executionCommand.setStateFailed(Errno.ERRNO_FAILED.getCode(),
+ currentPackageContext.getString(R.string.error_executable_unset, executionCommand.getCommandIdAndLabelLogString()));
+ AppShell.processAppShellResult(null, executionCommand);
+ return null;
+ }
+
if (executionCommand.workingDirectory == null || executionCommand.workingDirectory.isEmpty())
executionCommand.workingDirectory = shellEnvironmentClient.getDefaultWorkingDirectoryPath();
if (executionCommand.workingDirectory.isEmpty())
diff --git a/termux-shared/src/main/res/values/strings.xml b/termux-shared/src/main/res/values/strings.xml
index a0111fc3..c9f1622b 100644
--- a/termux-shared/src/main/res/values/strings.xml
+++ b/termux-shared/src/main/res/values/strings.xml
@@ -62,6 +62,7 @@
Sending SIGKILL to process on user request or because android is killing the execution service
+ Executable not set \"%1$s\" for shell command
Execution has been cancelled since execution service is being killed
Failed to execute \"%1$s\" termux session command
Failed to execute \"%1$s\" app shell command