mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-24 18:26:11 +03:00
Merge pull request #5881 from Chocobo1/trackerfilter_crash
Fix crash in TrackerFiltersList::removeItem()
This commit is contained in:
commit
05387edbfa
1 changed files with 4 additions and 3 deletions
|
@ -523,7 +523,7 @@ void TrackerFiltersList::addItem(const QString &tracker, const QString &hash)
|
|||
void TrackerFiltersList::removeItem(const QString &tracker, const QString &hash)
|
||||
{
|
||||
QString host = getHost(tracker);
|
||||
QListWidgetItem *trackerItem = 0;
|
||||
QListWidgetItem *trackerItem = nullptr;
|
||||
QStringList tmp = m_trackers.value(host);
|
||||
int row = 0;
|
||||
|
||||
|
@ -531,7 +531,7 @@ void TrackerFiltersList::removeItem(const QString &tracker, const QString &hash)
|
|||
return;
|
||||
tmp.removeAll(hash);
|
||||
|
||||
if (host != "") {
|
||||
if (!host.isEmpty()) {
|
||||
// Remove from 'Error' and 'Warning' view
|
||||
trackerSuccess(hash, tracker);
|
||||
row = rowFromTracker(host);
|
||||
|
@ -544,7 +544,8 @@ void TrackerFiltersList::removeItem(const QString &tracker, const QString &hash)
|
|||
updateGeometry();
|
||||
return;
|
||||
}
|
||||
trackerItem->setText(tr("%1 (%2)", "openbittorrent.com (10)").arg(host).arg(tmp.size()));
|
||||
if (trackerItem != nullptr)
|
||||
trackerItem->setText(tr("%1 (%2)", "openbittorrent.com (10)").arg(host).arg(tmp.size()));
|
||||
}
|
||||
else {
|
||||
row = 1;
|
||||
|
|
Loading…
Reference in a new issue