Skip to content
Snippets Groups Projects
Commit e093a985 authored by Brad King's avatar Brad King
Browse files

Glob: Append warning message only if destination is non-null

Fix the change from commit f33ef4e3 (Glob: issue warnings on Directory
errors, 2020-05-12) to not append to nullptr messages.
parent 97f880e6
No related branches found
No related tags found
No related merge requests found
......@@ -184,10 +184,12 @@ bool Glob::RecurseDirectory(std::string::size_type start,
kwsys::Directory d;
std::string errorMessage;
if (!d.Load(dir, &errorMessage)) {
if (!errorMessage.empty()) {
messages->push_back(Message(Glob::warning,
"Error listing directory '" + dir +
"'! Reason: '" + errorMessage + "'"));
if (messages) {
if (!errorMessage.empty()) {
messages->push_back(Message(Glob::warning,
"Error listing directory '" + dir +
"'! Reason: '" + errorMessage + "'"));
}
}
return true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment