about summary refs log tree commit diff
path: root/absl/flags
diff options
context:
space:
mode:
Diffstat (limited to 'absl/flags')
-rw-r--r--absl/flags/parse.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/absl/flags/parse.cc b/absl/flags/parse.cc
index 5a56a35625df..2f07725f5614 100644
--- a/absl/flags/parse.cc
+++ b/absl/flags/parse.cc
@@ -525,7 +525,7 @@ std::tuple<bool, absl::string_view> DeduceFlagValue(const CommandLineFlag& flag,
     // --my_string_var --foo=bar
     // We look for a flag of std::string type, whose value begins with a
     // dash and corresponds to known flag or standalone --.
-    if (value[0] == '-' && flag.IsOfType<std::string>()) {
+    if (!value.empty() && value[0] == '-' && flag.IsOfType<std::string>()) {
       auto maybe_flag_name = std::get<0>(SplitNameAndValue(value.substr(1)));
 
       if (maybe_flag_name.empty() ||