fix: do not write log if file handler is bad (#5675)

This commit is contained in:
Geoffrey Bonneville 2023-06-27 11:44:10 -07:00 committed by Charles Kerr
parent d2200cf9ea
commit 115a069d8d
1 changed files with 5 additions and 0 deletions

View File

@ -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<char, 64>{};