Commit b6ba584d authored by Aard's avatar Aard

Return good repo url if adaptations don't exist -- duplicating repos is better than failing

parent 9879903c
......@@ -215,7 +215,12 @@ QString Ssu::repoUrl(QString repoName, bool rndRepo, QHash<QString, QString> rep
regex.lastIndexIn(repoName);
int n = regex.cap().toInt();
if (adaptationRepos.size() > n) {
if (!adaptationRepos.isEmpty()){
if (adaptationRepos.size() <= n) {
ssuLog->print(LOG_INFO, "Note: repo index out of bounds, substituting 0" + repoName);
n = 0;
}
QString adaptationRepo = adaptationRepos.at(n);
repoParameters.insert("adaptation", adaptationRepo);
ssuLog->print(LOG_DEBUG, "Found first adaptation " + repoName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment