Skip to content

Commit

Permalink
Fix a crash dereferencing m_ReplaySnapshotMap.rbegin()
Browse files Browse the repository at this point in the history
  • Loading branch information
hexptr authored and poco0317 committed Jul 15, 2020
1 parent 127d2fb commit 8b5b489
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Etterna/Models/Misc/PlayerAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@ PlayerAI::SetUpSnapshotMap(NoteData* pNoteData,

} else {
// If the current row is after the last recorded row, make a new one
if (m_ReplaySnapshotMap.rbegin()->first < row) {
if (m_ReplaySnapshotMap.empty() ||
m_ReplaySnapshotMap.rbegin()->first < row) {
ReplaySnapshot rs;
FOREACH_ENUM(TapNoteScore, tns)
rs.judgments[tns] = tempJudgments[tns];
Expand Down

0 comments on commit 8b5b489

Please sign in to comment.