Commit 926897e2 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make sure that it's not empty

parent 001d6afe
......@@ -692,6 +692,7 @@ QString Util::parseBodyStyle(const QString &style)
{
const int indexStyle = style.indexOf(QLatin1String("style=\""));
if (indexStyle != -1) {
//qDebug() << " style " << style;
const int indexEnd = style.indexOf(QLatin1Char('"'), indexStyle + 7);
if (indexEnd != -1) {
const QStringRef styleStr = style.midRef(indexStyle + 7, indexEnd - (indexStyle + 7));
......@@ -702,7 +703,9 @@ QString Util::parseBodyStyle(const QString &style)
lst.append(style.toString().trimmed());
}
}
return QStringLiteral(" style=\"%1").arg(lst.join(QLatin1Char(';'))) + QStringLiteral(";\"");
if (!lst.isEmpty()) {
return QStringLiteral(" style=\"%1").arg(lst.join(QLatin1Char(';'))) + QStringLiteral(";\"");
}
}
}
return QString();
......
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