Skip to content

Commit

Permalink
PackManager: Fall back to generic versions_url for invalid pack versi…
Browse files Browse the repository at this point in the history
…ons_url
  • Loading branch information
black-sliver committed Aug 29, 2024
1 parent 53ad682 commit d7860ad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/packmanager/packmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,13 @@ bool PackManager::checkForUpdate(const std::string& uid, const std::string& vers
// 2. determine which versions_url to use
std::string url = versions_url;
auto it = _packs.find(uid);
if (it != _packs.end() && it.value()["versions_url"].is_string())
if (it != _packs.end() && it.value()["versions_url"].is_string()) {
url = it.value()["versions_url"].get<std::string>();
if (!HTTP::is_uri(url)) {
fprintf(stderr, "WARNING: invalid versions_url in pack!");
url = versions_url;
}
}
if (url.empty()) {
printf("Nowhere to check for updates of %s\n", uid.c_str());
if (ncb) ncb(uid);
Expand Down

0 comments on commit d7860ad

Please sign in to comment.