mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-06 02:35:19 +08:00
Changed: Ensure AppShell
executable is not null
before trying to execute it
This commit is contained in:
@@ -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())
|
||||
|
@@ -62,6 +62,7 @@
|
||||
|
||||
<!-- Shell -->
|
||||
<string name="error_sending_sigkill_to_process">Sending SIGKILL to process on user request or because android is killing the execution service</string>
|
||||
<string name="error_executable_unset">Executable not set \"%1$s\" for shell command</string>
|
||||
<string name="error_execution_cancelled">Execution has been cancelled since execution service is being killed</string>
|
||||
<string name="error_failed_to_execute_termux_session_command">Failed to execute \"%1$s\" termux session command</string>
|
||||
<string name="error_failed_to_execute_app_shell_command">Failed to execute \"%1$s\" app shell command</string>
|
||||
|
Reference in New Issue
Block a user