Add hack to stop random crashes on editor leave.

I'm sure there is a better way, but this works right now.
This commit is contained in:
Jason Felds
2011-06-01 14:32:59 -04:00
parent 7d7e424c8b
commit 90ab6dfca8
+6 -1
View File
@@ -1475,8 +1475,13 @@ void TimingData::DeleteRows( int iStartRow, int iRowsToDelete )
float TimingData::GetDisplayedSpeedPercent( float fSongBeat, float fMusicSeconds ) const
{
/* HACK: Somehow we get called into this function when there is no
* TimingData to work with. This seems to happen the most upon
* leaving the editor. Still, cover our butts in case this instance
* isn't existing. */
if (!this) return 1.0f;
if( m_SpeedSegments.size() == 0 )
return 1.0;
return 1.0f;
const int index = GetSpeedSegmentIndexAtBeat( fSongBeat );