Changed: Ensure AppShell executable is not null before trying to execute it

This commit is contained in:
agnostic-apollo
2022-06-11 13:52:10 +05:00
parent b96fcb78fd
commit 042487c2b4
2 changed files with 8 additions and 0 deletions

View File

@@ -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())