Add a check in OnImportCheat to avoid crashing when can not get the title from cheat.db

This commit is contained in:
shenweip 2013-09-09 14:26:37 +08:00
parent 59bd524c90
commit a1191325e1

View File

@ -198,7 +198,8 @@ UI::EventReturn CwCheatScreen::OnImportCheat(UI::EventParams &params)
getline(is, title2);
is.close();
os.open(activeCheatFile.c_str(), std::ios::app);
if (title2.substr(0, 2) != "_S") {
auto it = title.begin();
if (title2.substr(0, 2) != "_S" && it != title.end() && (++it) != title.end()) {
os << title[0] << "\n" << title[1];
}
if (newList.size() != 0)