diff --git a/src/alignfunctor.cpp b/src/alignfunctor.cpp index 93c9d2ad944..c862fadf1aa 100644 --- a/src/alignfunctor.cpp +++ b/src/alignfunctor.cpp @@ -264,12 +264,11 @@ FunctorCode AlignHorizontallyFunctor::VisitLayerElement(LayerElement *layerEleme } else if (layerElement->Is(SYL)) { Staff *staff = layerElement->GetAncestorStaff(); - if (staff->m_drawingNotationType == NOTATIONTYPE_neume) { + Note *note = vrv_cast(layerElement->GetFirstAncestor(NOTE)); + if (!note || (staff->m_drawingNotationType == NOTATIONTYPE_neume)) { type = ALIGNMENT_DEFAULT; } else { - Note *note = vrv_cast(layerElement->GetFirstAncestor(NOTE)); - assert(note); layerElement->SetAlignment(note->GetAlignment()); } }