Skip to content

Commit

Permalink
Check fd_ is not nullptr in file_helper
Browse files Browse the repository at this point in the history
  • Loading branch information
gabime committed Jan 12, 2024
1 parent ae0eb75 commit 3379f24
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/details/file_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ void file_helper::close() {
}

void file_helper::write(const memory_buf_t &buf) {
if(fd_ == nullptr) return;
size_t msg_size = buf.size();
auto data = buf.data();
if (std::fwrite(data, 1, msg_size, fd_) != msg_size) {
Expand Down

0 comments on commit 3379f24

Please sign in to comment.