Crash when entering a newline before composer name

• Jun 22, 2020 - 13:45
Reported version
4.x-dev
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project

1) Load the score crash.mscz
2) Select composer name.
3) Move the cursor to just before the "C" of the composer name.
4) Press to move Composer to the next line.

Excepted result:
An empty line before Composer

Shown result:
A crash

This works in 3.x without any problem.

Attachment Size
crash.mscz 4.17 KB

Comments

Stacktrace of the crash:

1 Ms::CharFormat::CharFormat textbase.h 63 0xc8d0c4
2 Ms::TextCursor::selectedFragmentsFormat textbase.cpp 203 0x16c1c89
3 Ms::TextBase::getProperty textbase.cpp 2558 0x16cdbe2
4 AbstractInspectorModel::loadPropertyItem(PropertyItem *, std::function) abstractinspectormodel.cpp 392 0x13db48e
5 TextSettingsModel::loadProperties textsettingsmodel.cpp 66 0x1426db7
6 AbstractInspectorModel::updateProperties abstractinspectormodel.cpp 195 0x13d9dac
7 AbstractInspectorModel::qt_static_metacall moc_abstractinspectormodel.cpp 260 0x13c73ae
8 QMetaObject::activate qobject.cpp 3804 0x7fffe9d7de39
9 ElementRepositoryService::elementsUpdated moc_elementrepositoryservice.cpp 133 0x13d348d
10 ElementRepositoryService::updateElementList elementrepositoryservice.cpp 29 0x142a297
11 InspectorListModel::setElementList inspectorlistmodel.cpp 60 0x13e8d9a
12 InspectorFormWidget::onSelectionChanged inspectorformwidget.cpp 32 0x13c650d
13 InspectorDockWidget::update inspectordockwidget.cpp 44 0x13c595a
14 Ms::MuseScore::updateInspector musescore.cpp 2492 0xc1e888
15 Ms::MuseScore::endCmd musescore.cpp 6416 0xc3617e
16 Ms::Score::endCmd cmd.cpp 290 0x1723e6e
17 Ms::ScoreViewCmdContext::~ScoreViewCmdContext events.cpp 824 0xf3e6a9
18 Ms::ScoreView::keyPressEvent events.cpp 929 0xf3cb54
19 QWidget::event qwidget.cpp 8996 0x7ffff35010f7
20 Ms::ScoreView::event events.cpp 109 0xf394e4
...

Status PR created fixed

Fixed in branch master, commit edcb76bacd

_Fix #307059 - Crash when entering a newline before composer name

If a TextFragment is empty TextCursor::selectedFragmentsFormat() will create
a default CharFormat object instead of retrieving a non-existent one._