From f5de997e53372e561ad5a415cea88cbe7060186f Mon Sep 17 00:00:00 2001 From: chenxiaobaobb <2664761650@qq.com> Date: Thu, 31 Oct 2024 06:39:37 +0000 Subject: [PATCH] =?UTF-8?q?update=20services/common/src/time=5Fprovider.cp?= =?UTF-8?q?p.=20=EF=BC=88cherry=20picked=20commit=20from=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/common/src/time_provider.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/common/src/time_provider.cpp b/services/common/src/time_provider.cpp index ec9b13b..e2fe0fd 100644 --- a/services/common/src/time_provider.cpp +++ b/services/common/src/time_provider.cpp @@ -153,6 +153,10 @@ int32_t TimeProvider::GetCurrentDate() { time_t now = std::time(0); tm* local_time = localtime(&now); + if (local_time == nullptr) { + STANDBYSERVICE_LOGE("get local time failed"); + return 0; + } return local_time->tm_mday; } } // namespace DevStandbyMgr -- Gitee