Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions allscripts(deprecated).js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ register('fill', function (pat) {
// Find the next onset, to use as an offset
const next = onsets.find(onset => onset.gte(hap.whole.end));

// If there is no next onset, the query window is not large enough.
// We bail out to avoid a crash.
if (next === undefined) {
continue;
}

// Ignore if the part ended before the original query, and hasn't expanded inside
if (next.lte(state.span.begin)) {
continue;
Expand Down
6 changes: 6 additions & 0 deletions prebake.strudel
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ register('fill', function (pat) {
// Find the next onset, to use as an offset
const next = onsets.find(onset => onset.gte(hap.whole.end));

// If there is no next onset, the query window is not large enough.
// We bail out to avoid a crash.
if (next === undefined) {
continue;
}

// Ignore if the part ended before the original query, and hasn't expanded inside
if (next.lte(state.span.begin)) {
continue;
Expand Down