Commit 89b74eee authored by Jonathan Thomas's avatar Jonathan Thomas
Browse files

- Discard reviews with null package pointers

- Do not attempt to display reviews with null package pointers, if encountered in the
  ReviewWidget

BUG:293058
FIXED-IN: 1.3.0
parent b4b70fef
......@@ -78,6 +78,9 @@ ReviewWidget::~ReviewWidget()
void ReviewWidget::setReview(Review *review)
{
if (!review->package())
return;
m_ratingWidget->setRating(review->rating());
m_summaryLabel->setText(QLatin1Literal("<b>") % review->summary()
......
......@@ -211,8 +211,12 @@ void ReviewsBackend::reviewsFetched(KJob *job)
QList<Review *> reviewsList;
foreach (const QVariant &data, reviews.toList()) {
Review *review = new Review(data.toMap());
review->setPackage(m_aptBackend->package(review->packageName()));
reviewsList << review;
QApt::Package *package = m_aptBackend->package(review->packageName());
if (package) {
review->setPackage(package);
reviewsList << review;
}
}
Application *app = m_jobHash.value(job);
......
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