Fix crash in mprisremote when data for an unknown player arrives

This commit is contained in:
Nicolas Fella 2019-01-31 00:52:56 +01:00
parent d650faaa4f
commit 72610654fc

View file

@ -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"))) {