diff --git a/src/node_file.cc b/src/node_file.cc index 906109e121ae82..e14532d276ee80 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -237,7 +237,7 @@ BaseObjectPtr FileHandle::TransferData::Deserialize( // JS during GC. If closing the fd fails at this point, a fatal exception // will crash the process immediately. inline void FileHandle::Close() { - if (closed_) return; + if (closed_ || closing_) return; uv_fs_t req; int ret = uv_fs_close(env()->event_loop(), &req, fd_, nullptr); uv_fs_req_cleanup(&req);