added condition for empty loader type

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2023-08-25 09:05:04 +03:00
parent 172680abf8
commit c54fecf5d9
5 changed files with 8 additions and 7 deletions

View File

@ -105,7 +105,7 @@ void Modrinth::loadIndexedPackVersions(ModPlatform::IndexedPack& pack, QJsonArra
auto file = loadIndexedPackVersion(obj);
if (file.fileId.isValid() &&
(!loaders.has_value() || loaders.value() & file.loaders)) // Heuristic to check if the returned value is valid
(!loaders.has_value() || !file.loaders || loaders.value() & file.loaders)) // Heuristic to check if the returned value is valid
unsortedVersions.append(file);
}
auto orderSortPredicate = [](const ModPlatform::IndexedVersion& a, const ModPlatform::IndexedVersion& b) -> bool {
@ -242,7 +242,7 @@ auto Modrinth::loadDependencyVersions([[maybe_unused]] const ModPlatform::Depend
auto file = loadIndexedPackVersion(obj);
if (file.fileId.isValid() &&
(!loaders.has_value() || loaders.value() & file.loaders)) // Heuristic to check if the returned value is valid
(!loaders.has_value() || !file.loaders || loaders.value() & file.loaders)) // Heuristic to check if the returned value is valid
versions.append(file);
}
auto orderSortPredicate = [](const ModPlatform::IndexedVersion& a, const ModPlatform::IndexedVersion& b) -> bool {