diff options
Diffstat (limited to 'lib/nes/common/path-view.cc')
| -rw-r--r-- | lib/nes/common/path-view.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/nes/common/path-view.cc b/lib/nes/common/path-view.cc index 47f198b..743c060 100644 --- a/lib/nes/common/path-view.cc +++ b/lib/nes/common/path-view.cc @@ -1,10 +1,12 @@ #include "nes/common/path-view.hh" +#include "nes/common/debug.hh" namespace nes { auto path_view::iterator::operator*() const -> std::string_view { - return current_ ? std::string_view{ current_, component_length_ } : ""; + NES_ASSERT(current_ != nullptr && component_length_ > 0 && "invalid iterator"); + return std::string_view{ current_, component_length_ }; } auto path_view::iterator::operator++() -> iterator& |
