Commit 93e57760 authored by Jonathan Thomas's avatar Jonathan Thomas
Browse files

Do not used numeric indexed addressing without size checks.

Fixes a crash when the partner repository is disabled and software origins are sorted
into past the end of the origins list.

BUG:291262
FIXED-IN:1.2.3
parent 5beb4710
......@@ -216,13 +216,15 @@ void ApplicationWindow::populateViews()
originNames.move(index, 0); // Move to front of the list
if (originNames.contains("Canonical")) {
int index = originNames.indexOf("Canonical");
originNames.move(index, 1); // Move to 2nd spot
int index = originNames.indexOf("Canonical");
if (originNames.size() >= 2)
originNames.move(index, 1); // Move to 2nd spot
}
if (originNames.contains("LP-PPA-app-review-board")) {
int index = originNames.indexOf("LP-PPA-app-review-board");
originNames.move(index, 2); // Move to third spot
if (originNames >= 3)
originNames.move(index, 2); // Move to third spot
}
}
......@@ -299,13 +301,15 @@ void ApplicationWindow::populateViews()
instOriginNames.move(index, 0); // Move to front of the list
if (instOriginNames.contains("Canonical")) {
int index = instOriginNames.indexOf("Canonical");
instOriginNames.move(index, 1); // Move to 2nd spot
int index = instOriginNames.indexOf("Canonical");
if (originNames.size() >= 2)
instOriginNames.move(index, 1); // Move to 2nd spot
}
if (instOriginNames.contains("LP-PPA-app-review-board")) {
int index = instOriginNames.indexOf("LP-PPA-app-review-board");
originNames.move(index, 2); // Move to third spot
if (originNames.size() >= 2)
originNames.move(index, 2); // Move to third spot
}
}
......
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