mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-01 07:28:03 +08:00
Fix a crash with -d5 and block processes
This commit is contained in:
parent
335c41f097
commit
df4a41ff81
|
@ -203,7 +203,12 @@ class job_t {
|
|||
/// untruncated job string when we don't care what the job is, only which of the currently
|
||||
/// running jobs it is.
|
||||
wcstring preview() const {
|
||||
return processes.empty() ? L"" : processes[0]->argv0() + wcstring(L" ...");
|
||||
if (processes.empty())
|
||||
return L"";
|
||||
// Note argv0 may be empty in e.g. a block process.
|
||||
const wchar_t *argv0 = processes.front()->argv0();
|
||||
wcstring result = argv0 ? argv0 : L"null";
|
||||
return result + L" ...";
|
||||
}
|
||||
|
||||
/// All the processes in this job.
|
||||
|
|
Loading…
Reference in New Issue
Block a user