From c40a1217e87fed99ebe00cbd26b848e16b56a9d8 Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 8 Oct 2019 21:17:42 +0300 Subject: [PATCH] Fix empty path in FileLog. GitOrigin-RevId: be64892045a8ee3497f89963d8f18265b4f6991d --- tdutils/td/utils/FileLog.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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));