Avoid asserting if we get a box art load completion callback for an app that's gone
This commit is contained in:
parent
c31e7262b2
commit
eb1316ce32
1 changed files with 10 additions and 5 deletions
|
|
@ -123,10 +123,15 @@ void AppModel::handleBoxArtLoaded(NvComputer* computer, NvApp app, QUrl /* image
|
||||||
Q_ASSERT(computer == m_Computer);
|
Q_ASSERT(computer == m_Computer);
|
||||||
|
|
||||||
int index = m_Apps.indexOf(app);
|
int index = m_Apps.indexOf(app);
|
||||||
Q_ASSERT(index >= 0);
|
|
||||||
|
|
||||||
// Let our view know the box art data has changed for this app
|
// Make sure we're not delivering a callback to an app that's already been removed
|
||||||
emit dataChanged(createIndex(index, 0),
|
if (index >= 0) {
|
||||||
createIndex(index, 0),
|
// Let our view know the box art data has changed for this app
|
||||||
QVector<int>() << BoxArtRole);
|
emit dataChanged(createIndex(index, 0),
|
||||||
|
createIndex(index, 0),
|
||||||
|
QVector<int>() << BoxArtRole);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
qWarning() << "App not found for box art callback:" << app.name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue