mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-03 01:04:13 +02:00
c0b8472665
A contact (slave) not linked to a coil has no element to take its label from: DynamicElementTextItem::elementUseForInfo() returns null. Since8985babfe(#978) the composite-text branch of updateLabel() called element->actualLabel() without checking, so a text built from %{label} on such a contact crashed QElectroTech while the project was loading (QETProject::refresh -> Diagram::refreshContents). The project could not be opened again. Check the element as the ElementInfo branch above already does; with no element, %{label} shows empty, as it did before8985babfe. Test: tst_resaveunchanged opens a blank project holding one unlinked contact with a %{label} text. It fails without the fix (the --resave crashes) and passes with it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>