Skip to content

Commit e7bbc30

Browse files
authored
Return empty string when date is null (#649)
Signed-off-by: Raul Metsma <[email protected]>
1 parent ab797fb commit e7bbc30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/DateTime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ string date::to_string(time_t t)
6868
string date::to_string(const tm &date)
6969
{
7070
string result(20, 0);
71-
if(strftime(result.data(), result.size() + 1, "%Y-%m-%dT%H:%M:%SZ", &date) == 0)
71+
if(is_empty(date) || strftime(result.data(), result.size() + 1, "%Y-%m-%dT%H:%M:%SZ", &date) == 0)
7272
result.clear();
7373
return result;
7474
}

0 commit comments

Comments
 (0)