in automationPattern::valueAt() check whether the time-map is empty

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1236 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-06-30 16:54:54 +00:00
parent 4274c51dae
commit 884c9222ba

View File

@@ -218,6 +218,10 @@ void automationPattern::openInAutomationEditor( void )
float automationPattern::valueAt( const midiTime & _time )
{
if( m_timeMap.isEmpty() )
{
return( 0 );
}
timeMap::const_iterator v = m_timeMap.lowerBound( _time );
return( ( v != m_timeMap.end() ) ? v.value() : (v-1).value() );
}