Commit d521b3a7 authored by Milian Wolff's avatar Milian Wolff
Browse files

prevent crash when config file contains something like "foo||"

BUG: 240509
parent 3f21439f
......@@ -173,8 +173,8 @@ void SourceFormatterSettings::load()
LanguageSettings& l = languages[name];
QList<QString> mimetypes = mimetypesForLanguageName(name);
foreach (const QString& mimetype, mimetypes) {
QStringList formatterAndStyleName = grp.readEntry( mimetype, "" ).split( "||", QString::SkipEmptyParts );
if ( !formatterAndStyleName.isEmpty() ) {
QStringList formatterAndStyleName = grp.readEntry( mimetype, "" ).split( "||", QString::KeepEmptyParts );
if ( formatterAndStyleName.size() == 2 ) {
FormatterMap::const_iterator formatterIter = formatters.constFind(formatterAndStyleName.first());
if (formatterIter == formatters.constEnd()) {
kDebug() << "Reference to unknown formatter" << formatterAndStyleName.first();
......
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