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

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

CCBUG: 240509
parent a49020aa
......@@ -136,9 +136,9 @@ void SourceFormatterSettings::load()
foreach( const QString& name, languages.keys() )
{
KConfigGroup grp = fmtctrl->configuration();
QStringList formatter = grp.readEntry( name, "" ).split( "||", QString::SkipEmptyParts );
QStringList formatter = grp.readEntry( name, "" ).split( "||", QString::KeepEmptyParts );
SourceFormatterLanguage l = languages[name];
if( formatter.isEmpty() || !l.formatters.contains( formatter.first() ) ) {
if( formatter.count() != 2 || !l.formatters.contains( formatter.first() ) ) {
l.selectedFmt = l.formatters.begin().key();
SourceFormatter fmt = l.formatters[l.selectedFmt];
if( !fmt.styles.isEmpty() )
......
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