mirror of
https://github.com/joel16/NX-Shell.git
synced 2024-11-26 21:20:27 +00:00
Fixed crash when pressing Y in an empty directory (#102)
This commit is contained in:
parent
c36f52cd18
commit
097ac8225c
@ -118,12 +118,14 @@ namespace GUI {
|
||||
}
|
||||
else if (button == SDL_KEY_Y) {
|
||||
if (item.state == MENU_STATE_FILEBROWSER) {
|
||||
if ((!item.checked_cwd.empty()) && (item.checked_cwd.compare(cfg.cwd) != 0))
|
||||
GUI::ResetCheckbox();
|
||||
if (item.selected < static_cast<int>(item.checked.size())) {
|
||||
if ((!item.checked_cwd.empty()) && (item.checked_cwd.compare(cfg.cwd) != 0))
|
||||
GUI::ResetCheckbox();
|
||||
|
||||
item.checked_cwd = cfg.cwd;
|
||||
item.checked.at(item.selected) = !item.checked.at(item.selected);
|
||||
item.checked_count = std::count(item.checked.begin(), item.checked.end(), true);
|
||||
item.checked_cwd = cfg.cwd;
|
||||
item.checked.at(item.selected) = !item.checked.at(item.selected);
|
||||
item.checked_count = std::count(item.checked.begin(), item.checked.end(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (button == SDL_KEY_DLEFT) {
|
||||
|
Loading…
Reference in New Issue
Block a user