Add workaround for crash on some jdenticon inputs

This commit is contained in:
Nicolas Werner 2021-09-14 16:10:04 +02:00
parent f032c75e6a
commit f91a0267e6
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -62,9 +62,14 @@ JdenticonResponse::run()
painter.setRenderHint(QPainter::Antialiasing, true); painter.setRenderHint(QPainter::Antialiasing, true);
painter.setRenderHint(QPainter::SmoothPixmapTransform, true); painter.setRenderHint(QPainter::SmoothPixmapTransform, true);
try {
QSvgRenderer renderer{ QSvgRenderer renderer{
jdenticonInterface_->generate(m_key, m_requestedSize.width()).toUtf8()}; jdenticonInterface_->generate(m_key, m_requestedSize.width()).toUtf8()};
renderer.render(&painter); renderer.render(&painter);
} catch (std::exception &e) {
nhlog::ui()->error(
"caught {} in jdenticonprovider, key '{}'", e.what(), m_key.toStdString());
}
painter.end(); painter.end();