Skip to content

Commit 822c3f9

Browse files
committed
Fix incorrect check for pattern validity
1 parent cbae318 commit 822c3f9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/application/service/editor_service.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,9 @@ bool EditorService::requestPosition(quint64 pattern, quint64 track, quint64 colu
12951295
{
12961296
juzzlin::L(TAG).debug() << "Requesting position: " << pattern << " " << track << " " << column << " " << line << " " << lineColumn;
12971297

1298-
if (pattern >= m_song->patternCount()) {
1298+
const auto patternIndices = m_song->patternIndices();
1299+
if (const auto it = std::ranges::find(patternIndices, pattern);
1300+
it == patternIndices.end()) {
12991301
juzzlin::L(TAG).error() << "Invalid pattern index: " << pattern;
13001302
return false;
13011303
}

0 commit comments

Comments
 (0)