Fix crash in mprisremote when data for an unknown player arrives
This commit is contained in:
parent
d650faaa4f
commit
72610654fc
1 changed files with 5 additions and 1 deletions
|
@ -50,7 +50,11 @@ bool MprisRemotePlugin::receivePacket(const NetworkPacket& np)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (np.has(QStringLiteral("player"))) {
|
if (np.has(QStringLiteral("player"))) {
|
||||||
m_players[np.get<QString>(QStringLiteral("player"))]->parseNetworkPacket(np);
|
const QString player = np.get<QString>(QStringLiteral("player"));
|
||||||
|
if(!m_players.contains(player)) {
|
||||||
|
m_players[player] = new MprisRemotePlayer();
|
||||||
|
}
|
||||||
|
m_players[player]->parseNetworkPacket(np);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (np.has(QStringLiteral("playerList"))) {
|
if (np.has(QStringLiteral("playerList"))) {
|
||||||
|
|
Loading…
Reference in a new issue