Commit d0a707b3 authored by Tobias Hunger's avatar Tobias Hunger Committed by Brad King
Browse files

server-mode: Prevent possible crash when watching directories

The `filename` passed by libuv may be `nullptr`, so handle that
explicitly.

Fixes: #16422
parent 5cfc2e92
......@@ -288,7 +288,7 @@ void on_directory_change(uv_fs_event_t* handle, const char* filename,
{
const cmIBaseWatcher* const watcher =
static_cast<const cmIBaseWatcher*>(handle->data);
const std::string pathSegment(filename);
const std::string pathSegment(filename ? filename : "");
watcher->Trigger(pathSegment, events, status);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment