Skip to content

Commit 3a6268f

Browse files
authored
Added emptiness check to the LogStream &operator<< with std::string_view (#2234)
1 parent 47f8af7 commit 3a6268f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/inc/drogon/utils/Utilities.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,8 @@ namespace trantor
584584
{
585585
inline LogStream &operator<<(LogStream &ls, const std::string_view &v)
586586
{
587-
ls.append(v.data(), v.length());
587+
if (!v.empty())
588+
ls.append(v.data(), v.length());
588589
return ls;
589590
}
590591

0 commit comments

Comments
 (0)