Skip to content

Commit

Permalink
Return empty string when date is null (#649)
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma authored Dec 3, 2024
1 parent ab797fb commit e7bbc30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/DateTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ string date::to_string(time_t t)
string date::to_string(const tm &date)
{
string result(20, 0);
if(strftime(result.data(), result.size() + 1, "%Y-%m-%dT%H:%M:%SZ", &date) == 0)
if(is_empty(date) || strftime(result.data(), result.size() + 1, "%Y-%m-%dT%H:%M:%SZ", &date) == 0)
result.clear();
return result;
}

0 comments on commit e7bbc30

Please sign in to comment.