mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-08-29 13:30:34 +00:00
Avoid asserting if we get a box art load completion callback for an app that's gone
This commit is contained in:
+10
-5
@@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user