Fix crash if string_to_color is passed an empty string
This commit is contained in:
parent
e338869b01
commit
4927e71ed1
1 changed files with 1 additions and 1 deletions
|
@ -66,7 +66,7 @@ color_t string_to_color(const std::string &cmp_str)
|
|||
return font::BLUE_COLOR;
|
||||
}
|
||||
|
||||
if (cmp_str.at(0) == '#' && cmp_str.size() == 7) {
|
||||
if (cmp_str.size() == 7 && cmp_str.at(0) == '#') {
|
||||
// #rrggbb color, pango format.
|
||||
return color_t::from_hex_string(cmp_str.substr(1));
|
||||
} else if (cmp_str.size() == 6) {
|
||||
|
|
Loading…
Add table
Reference in a new issue