From 3ded68c67693dc7a80639aef3548751c1b2da016 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Tue, 19 Dec 2023 10:20:53 +0100 Subject: [PATCH] Fix crash when converting mensural notation from Humdrum --- src/doc.cpp | 3 +++ src/iohumdrum.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/src/doc.cpp b/src/doc.cpp index e79a92b74b0..e1dc8fb97de 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -1291,6 +1291,9 @@ void Doc::ConvertToCastOffMensuralDoc(bool castOff) m_isMensuralMusicOnly = false; } + // Calling Doc::PrepareData is expected to collect visible scores + assert(m_dataPreparationDone); + // Make sure the document is not cast-off this->UnCastOffDoc(); diff --git a/src/iohumdrum.cpp b/src/iohumdrum.cpp index 4353e83816a..be58d5bb7ca 100644 --- a/src/iohumdrum.cpp +++ b/src/iohumdrum.cpp @@ -31612,6 +31612,7 @@ void HumdrumInput::finalizeDocument(Doc *doc) if (m_mens) { doc->SetMensuralMusicOnly(true); doc->m_notationType = NOTATIONTYPE_mensural; + doc->PrepareData(); doc->ConvertToCastOffMensuralDoc(true); } }