Browse Source

Merge topic 'cmake-server-fix-16422'

d0a707b3 server-mode: Prevent possible crash when watching directories
Brad King 9 năm trước cách đây
mục cha
commit
fcfddc67ed
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      Source/cmFileMonitor.cxx

+ 1 - 1
Source/cmFileMonitor.cxx

@@ -291,7 +291,7 @@ void on_directory_change(uv_fs_event_t* handle, const char* filename,
 {
 {
   const cmIBaseWatcher* const watcher =
   const cmIBaseWatcher* const watcher =
     static_cast<const cmIBaseWatcher*>(handle->data);
     static_cast<const cmIBaseWatcher*>(handle->data);
-  const std::string pathSegment(filename);
+  const std::string pathSegment(filename ? filename : "");
   watcher->Trigger(pathSegment, events, status);
   watcher->Trigger(pathSegment, events, status);
 }
 }