mirror of
https://github.com/gabime/spdlog.git
synced 2025-04-01 02:42:41 +08:00
Check fd_ is not nullptr in file_helper
This commit is contained in:
parent
ae0eb75402
commit
3379f242e1
@ -92,6 +92,7 @@ void file_helper::close() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void file_helper::write(const memory_buf_t &buf) {
|
void file_helper::write(const memory_buf_t &buf) {
|
||||||
|
if(fd_ == nullptr) return;
|
||||||
size_t msg_size = buf.size();
|
size_t msg_size = buf.size();
|
||||||
auto data = buf.data();
|
auto data = buf.data();
|
||||||
if (std::fwrite(data, 1, msg_size, fd_) != msg_size) {
|
if (std::fwrite(data, 1, msg_size, fd_) != msg_size) {
|
||||||
|
Loading…
Reference in New Issue
Block a user