diff options
| author | Hannes Schulze <haschu0103@outlook.de> | 2025-02-04 23:11:08 +0100 |
|---|---|---|
| committer | Hannes Schulze <haschu0103@outlook.de> | 2025-02-04 23:11:08 +0100 |
| commit | 79553ab1fa3d707612e80dd03bf95ca65fa0c411 (patch) | |
| tree | f44bec41548d569cfca43c44e0e4ffa7b72ed4ed /lib/nes/common/path-view.cc | |
| parent | 9c45e9c7df1efa5bc1c8e73b6eaef4726b828d3e (diff) | |
refactor file browser
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& |
