Check for empty slug before setting pack url
This commit is contained in:
parent
8f61633551
commit
bd8b61651a
@ -12,7 +12,13 @@ void Modrinth::loadIndexedPack(ModPlatform::IndexedPack& pack, QJsonObject& obj)
|
|||||||
{
|
{
|
||||||
pack.addonId = Json::requireString(obj, "project_id");
|
pack.addonId = Json::requireString(obj, "project_id");
|
||||||
pack.name = Json::requireString(obj, "title");
|
pack.name = Json::requireString(obj, "title");
|
||||||
|
|
||||||
|
QString slug = Json::ensureString(obj, "slug", "");
|
||||||
|
if (!slug.isEmpty())
|
||||||
pack.websiteUrl = "https://modrinth.com/mod/" + Json::ensureString(obj, "slug", "");
|
pack.websiteUrl = "https://modrinth.com/mod/" + Json::ensureString(obj, "slug", "");
|
||||||
|
else
|
||||||
|
pack.websiteUrl = "";
|
||||||
|
|
||||||
pack.description = Json::ensureString(obj, "description", "");
|
pack.description = Json::ensureString(obj, "description", "");
|
||||||
|
|
||||||
pack.logoUrl = Json::requireString(obj, "icon_url");
|
pack.logoUrl = Json::requireString(obj, "icon_url");
|
||||||
|
Loading…
Reference in New Issue
Block a user