Skip to content

Commit

Permalink
stop crashing when reading corrupted replays hopefully
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Jan 2, 2025
1 parent 44a8430 commit b4cd354
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Etterna/Models/HighScore/Replay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,11 @@ Replay::LoadReplayDataBasic(const std::string& replayDir) -> bool
"should delete it or move it out",
GetScoreKey());
ASSERT(tokens.size() < 2);
} else if (tokens.size() < 2) {
throw std::runtime_error(
fmt::format("Not at least 2 tokens in basic replay? {} "
"tokens - corrupted replay?",
tokens.size()));
}

noteRow = std::stoi(tokens[0]);
Expand Down

0 comments on commit b4cd354

Please sign in to comment.