From 79553ab1fa3d707612e80dd03bf95ca65fa0c411 Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Tue, 4 Feb 2025 23:11:08 +0100 Subject: refactor file browser --- lib/nes/common/path-view.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/nes/common/path-view.cc') 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& -- cgit v1.3.1