Fixed an issue where scraping using TheGamesDB would crash the application

This commit is contained in:
Leon Styhre 2024-08-24 11:58:03 +02:00
parent b71b0d1abf
commit ae779a42e6

View file

@ -258,7 +258,8 @@ void GuiScraperSearch::resizeMetadata()
float maxLblWidth {0.0f}; float maxLblWidth {0.0f};
for (auto it = mMD_Pairs.cbegin(); it != mMD_Pairs.cend(); ++it) { for (auto it = mMD_Pairs.cbegin(); it != mMD_Pairs.cend(); ++it) {
it->first->setFont(fontLbl); it->first->setFont(fontLbl);
if (it->first->getTextCache()->metrics.size.x > maxLblWidth) if (it->first->getTextCache() != nullptr &&
it->first->getTextCache()->metrics.size.x > maxLblWidth)
maxLblWidth = it->first->getTextCache()->metrics.size.x + maxLblWidth = it->first->getTextCache()->metrics.size.x +
(16.0f * (mRenderer->getIsVerticalOrientation() ? (16.0f * (mRenderer->getIsVerticalOrientation() ?
mRenderer->getScreenHeightModifier() : mRenderer->getScreenHeightModifier() :