diff --git a/tdutils/td/utils/FileLog.cpp b/tdutils/td/utils/FileLog.cpp index 89ddf4ac0..28aa9eae4 100644 --- a/tdutils/td/utils/FileLog.cpp +++ b/tdutils/td/utils/FileLog.cpp @@ -18,13 +18,13 @@ namespace td { Status FileLog::init(string path, int64 rotate_threshold, bool redirect_stderr) { + if (path.empty()) { + return Status::Error("Log file path can't be empty"); + } if (path == path_) { set_rotate_threshold(rotate_threshold); return Status::OK(); } - if (path.empty()) { - return Status::Error("Log file path can't be empty"); - } TRY_RESULT(fd, FileFd::open(path, FileFd::Create | FileFd::Write | FileFd::Append));