Prevent crash when calling getTime() on an empty DTSC::Stream

This commit is contained in:
Thulinma 2014-01-07 23:40:38 +01:00
parent 1477939924
commit 10e4a78398

View file

@ -34,6 +34,9 @@ void DTSC::Stream::deletionCallback(livePos deleting){}
/// Returns the time in milliseconds of the last received packet.
/// This is _not_ the time this packet was received, only the stored time.
unsigned int DTSC::Stream::getTime(){
if ( !buffers.size()){
return 0;
}
return buffers.rbegin()->second["time"].asInt();
}