Commit 4edc105d authored by David Schulz's avatar David Schulz

Editor: Check if text codec pointer is valid.

Fixes a crash when collecting codecs for opions page and a unsupported
icu is used.

Task-number: QTCREATORBUG-16114
Change-Id: I4081748f636602670e37465750862d4da4a14941
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
parent 211894d3
......@@ -63,14 +63,15 @@ BehaviorSettingsWidget::BehaviorSettingsWidget(QWidget *parent)
if (firstNonNegative != mibs.end())
std::rotate(mibs.begin(), firstNonNegative, mibs.end());
foreach (int mib, mibs) {
QTextCodec *codec = QTextCodec::codecForMib(mib);
QString compoundName = QLatin1String(codec->name());
foreach (const QByteArray &alias, codec->aliases()) {
compoundName += QLatin1String(" / ");
compoundName += QString::fromLatin1(alias);
if (QTextCodec *codec = QTextCodec::codecForMib(mib)) {
QString compoundName = QLatin1String(codec->name());
foreach (const QByteArray &alias, codec->aliases()) {
compoundName += QLatin1String(" / ");
compoundName += QString::fromLatin1(alias);
}
d->m_ui.encodingBox->addItem(compoundName);
d->m_codecs.append(codec);
}
d->m_ui.encodingBox->addItem(compoundName);
d->m_codecs.append(codec);
}
// Qt5 doesn't list the system locale (QTBUG-34283), so add it manually
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment