diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp index 96b7d147..3c436d27 100644 --- a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp +++ b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp @@ -138,7 +138,7 @@ void Modrinth::ListModel::searchRequestFinished() QVector newList; QJsonArray hits; - int total_hits; + int total_hits = 0; try { @@ -149,6 +149,7 @@ void Modrinth::ListModel::searchRequestFinished() catch(const JSONValidationError &e) { qWarning() << "Error while parsing response from Modrinth: " << e.cause(); + return; } for (auto packRaw : hits)