Skip to content

Commit

Permalink
Return good repo url if adaptations don't exist -- duplicating repos …
Browse files Browse the repository at this point in the history
…is better than failing
  • Loading branch information
Bernd Wachter committed Mar 27, 2013
1 parent 9879903 commit b6ba584
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libssu/ssu.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit b6ba584

Please sign in to comment.