summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/util/AllocatedString.hxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/util/AllocatedString.hxx b/src/util/AllocatedString.hxx
index f2bc4f4fa..a1f8cd073 100644
--- a/src/util/AllocatedString.hxx
+++ b/src/util/AllocatedString.hxx
@@ -125,7 +125,9 @@ public:
}
operator string_view() const noexcept {
- return value;
+ return value != nullptr
+ ? string_view(value)
+ : string_view();
}
constexpr const_pointer c_str() const noexcept {