diff --git a/src/completion.cc b/src/completion.cc index 3ab9b92b..17482d14 100644 --- a/src/completion.cc +++ b/src/completion.cc @@ -28,6 +28,9 @@ CandidateList complete_filename(const std::string& prefix, auto dir = auto_raii(opendir(dirname.c_str()), closedir); CandidateList result; + if (not dir) + return result; + while (dirent* entry = readdir(dir)) { std::string filename = entry->d_name;