diff --git a/libtransmission/log.cc b/libtransmission/log.cc index 38199396b..9e5e3b7d4 100644 --- a/libtransmission/log.cc +++ b/libtransmission/log.cc @@ -164,6 +164,11 @@ void logAddImpl( if (fp == TR_BAD_SYS_FILE) { fp = tr_sys_file_get_std(TR_STD_SYS_FILE_ERR); + // if fp is still bad, do not write log + if (fp == TR_BAD_SYS_FILE) + { + return; + } } auto timestr = std::array{};