Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homepage: fixed infinte loop if candidate_package = null #158

Merged
merged 4 commits into from
Mar 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/Views/Homepage.vala
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ namespace AppCenter {
newest_banner.margin = 24;

var newest_ids = houston.get_newest ();
int i = 0;
while (newest_ids.length > 0 && i < newest_ids.length) {
var candidate = newest_ids[i] + ".desktop";
foreach (var package in newest_ids) {
var candidate = package + ".desktop";
var candidate_package = AppCenterCore.Client.get_default ().get_package_for_id (candidate);

if (candidate_package != null) {
Expand All @@ -53,10 +52,7 @@ namespace AppCenter {
newest_banner.clicked.connect (() => {
package_selected (candidate_package);
});

i = newest_ids.length;
} else {
i++;
break;
}
}
}
Expand Down