瀏覽代碼

Merge topic 'cmake-server-fix-16422'

d0a707b3 server-mode: Prevent possible crash when watching directories
Brad King 9 年之前
父節點
當前提交
fcfddc67ed
共有 1 個文件被更改,包括 1 次插入1 次删除
  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 =
     static_cast<const cmIBaseWatcher*>(handle->data);
-  const std::string pathSegment(filename);
+  const std::string pathSegment(filename ? filename : "");
   watcher->Trigger(pathSegment, events, status);
 }