1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-04 21:27:58 +02:00

* Don't crash in StreamConnection without m_iodev.

This commit is contained in:
Christian Muehlhaeuser
2013-01-17 07:47:17 +01:00
parent e20d8c955e
commit 09a177ec51

View File

@@ -230,11 +230,14 @@ StreamConnection::handleMsg( msg_ptr msg )
// << "payload len" << msg->payload().length() // << "payload len" << msg->payload().length()
// << "written to device so far: " << m_badded; // << "written to device so far: " << m_badded;
if ( ((BufferIODevice*)m_iodev.data())->nextEmptyBlock() < 0 ) if ( !m_iodev || ( (BufferIODevice*)m_iodev.data() )->nextEmptyBlock() < 0 )
{ {
m_allok = true; m_allok = true;
// tell our iodev there is no more data to read, no args meaning a success: // tell our iodev there is no more data to read, no args meaning a success:
if ( m_iodev )
( (BufferIODevice*)m_iodev.data() )->inputComplete(); ( (BufferIODevice*)m_iodev.data() )->inputComplete();
shutdown(); shutdown();
} }
} }