mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Handle info.json homepage type mismatches
This commit is contained in:
parent
8b37a297d4
commit
94ceee3c7e
1 changed files with 14 additions and 1 deletions
|
@ -51,8 +51,21 @@ struct PluginMeta {
|
|||
}
|
||||
|
||||
explicit PluginMeta(const QJsonObject &obj)
|
||||
: homepage(obj.value("homepage").toString(""))
|
||||
{
|
||||
auto homepageObj = obj.value("homepage");
|
||||
if (homepageObj.isString())
|
||||
{
|
||||
this->homepage = homepageObj.toString();
|
||||
}
|
||||
else if (!homepageObj.isUndefined())
|
||||
{
|
||||
auto type = QString::fromStdString(
|
||||
std::string(magic_enum::enum_name(homepageObj.type())));
|
||||
this->errors.emplace_back(
|
||||
QString(
|
||||
"homepage is defined but is not a string (its type is %1)")
|
||||
.arg(type));
|
||||
}
|
||||
auto nameObj = obj.value("name");
|
||||
if (nameObj.isString())
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue