Fix a crash opening a project whose folio report arrow has no terminal

A folio report arrow's text looks for a wire to show: on the arrow
itself, else on the arrow it is linked to, through that arrow's first
terminal. Some report symbols have no terminal -- ref_voyant_2_h.elmt in
the collection, and older collections' arrows -- so a project linking an
arrow with no wire to one of them crashed QElectroTech as it opened.
The other arrow's terminals are now checked first, as the arrow's own
already were.

Found on a project attached to the forum (saved by 0.70), which crashed
on opening.

Test: tst_resaveunchanged::reportArrowWithoutTerminalOpens builds the
case from Projet_vierge.qet's own symbols; it crashes without the fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Wga9B92BNurDEtxxtCDxf
This commit is contained in:
ispyisail
2026-10-10 19:58:01 +13:00
parent d4352b72c1
commit 44b2129d5a
2 changed files with 58 additions and 1 deletions
@@ -1469,7 +1469,9 @@ void DynamicElementTextItem::setPotentialConductor()
m_watched_conductor = c_list.first();
connect(m_watched_conductor.data(), &Conductor::propertiesChange, this, &DynamicElementTextItem::conductorPropertiesChanged);
}
else if(m_watched_conductor.isNull() && m_other_report)
else if(m_watched_conductor.isNull() && m_other_report
//A report symbol can have no terminal (some older collections')
&& !m_other_report.data()->terminals().isEmpty())
{
if (!m_other_report.data()->terminals().first()->conductors().isEmpty())
{