add vector empty check

Signed-off-by: dengxiaoyu <dengxiaoyu6@huawei.com>
This commit is contained in:
dengxiaoyu 2024-07-11 12:33:37 +08:00
parent 1551ca7e76
commit bedbd6e940

View File

@ -419,7 +419,7 @@ void DmsContinueTime::ShowInfo(std::string& result)
int64_t DmsContinueTime::GetTotalTime()
{
HILOGD("GetTotalTime start, durationInfo_.size is %{public}lu", durationInfo_.size());
HILOGD("GetTotalTime start, durationInfo_.size is %{public}zu", durationInfo_.size());
if (durationInfo_.empty() || durationInfo_.size() < DMSDURATION_TOTALTIME) {
HILOGE("totalTime is not exist.");
return DMSDURATION_EMPTY_TIME;