OTHER: Fix segmentation fault when setting volume

promoe segfaulted when disconnected and the user tried to set the volume
fixes Ubuntu bug #455956
This commit is contained in:
Thomas Frauendorfer 2009-10-25 00:13:24 +02:00
parent 89a67e6bcc
commit c37eb2950d

View file

@ -245,6 +245,8 @@ calcVolume (int volume, int balance)
void void
XPlayback::setVolume (int new_volume) XPlayback::setVolume (int new_volume)
{ {
if (!m_client->isConnected ()) return;
// Don't echo values the server sent us back to it // Don't echo values the server sent us back to it
if (m_volume == new_volume) if (m_volume == new_volume)
return; return;
@ -271,6 +273,8 @@ XPlayback::setVolume (int new_volume)
void void
XPlayback::setBalance (int new_balance) XPlayback::setBalance (int new_balance)
{ {
if (!m_client->isConnected ()) return;
// Don't echo values the server sent back to the server // Don't echo values the server sent back to the server
if ((m_balance == new_balance) || m_onechannel) if ((m_balance == new_balance) || m_onechannel)
return; return;