Skip to content

Commit

Permalink
Prevent crash from trying to cache unrecognized stepstype
Browse files Browse the repository at this point in the history
not the completely correct fix
this may cause a song to have no steps in some situations
  • Loading branch information
poco0317 committed Jul 6, 2020
1 parent 282325f commit f4a698e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Etterna/Models/Songs/SongCacheIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,11 @@ SongCacheIndex::CacheSong(Song& song, const std::string& dir)
int64_t songID = sqlite3_last_insert_rowid(db->getHandle());
vector<Steps*> vpStepsToSave = song.GetStepsToSave();
for (auto steps : vpStepsToSave) {
if (steps->m_StepsType >= NUM_StepsType) {
LOG->Info("Not caching unrecognized stepstype in file %s",
dir.c_str());
continue;
}
if (steps->GetChartKey() == "") { // Avoid writing cache tags for
// invalid chartkey files(empty
// steps) -Mina
Expand Down

0 comments on commit f4a698e

Please sign in to comment.