summaryrefslogtreecommitdiff
path: root/src/item.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/item.cc')
-rw-r--r--src/item.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/item.cc b/src/item.cc
index 22e24738..48694727 100644
--- a/src/item.cc
+++ b/src/item.cc
@@ -329,6 +329,9 @@ bool item_t::valid() const
string item_context(const item_t& item, const string& desc)
{
std::size_t len = item.end_pos - item.beg_pos;
+ if (! len)
+ return "<no item context>";
+
assert(len > 0);
assert(len < 2048);