diff --git a/src/host/cmdline.cpp b/src/host/cmdline.cpp index c523ad9ab3c..ab2c08c63a6 100644 --- a/src/host/cmdline.cpp +++ b/src/host/cmdline.cpp @@ -20,7 +20,10 @@ bool IsWordDelim(const wchar_t wch) noexcept return true; } const auto& delimiters = ServiceLocator::LocateGlobals().WordDelimiters; - return std::ranges::find(delimiters, wch) != delimiters.end(); + if (!delimiters.empty()) + { + return std::ranges::find(delimiters, wch) != delimiters.end(); + } } bool IsWordDelim(const std::wstring_view& charData) noexcept @@ -38,9 +41,12 @@ int DelimiterClass(wchar_t wch) noexcept return 1; } const auto& delimiters = ServiceLocator::LocateGlobals().WordDelimiters; - if (std::find(delimiters.begin(), delimiters.end(), wch) != delimiters.end()) + if (!delimiters.empty()) { - return 2; + if (std::find(delimiters.begin(), delimiters.end(), wch) != delimiters.end()) + { + return 2; + } } return 0; }