Don't crash if Format is empty.

This commit is contained in:
Steve Checkoway
2006-08-14 04:49:27 +00:00
parent 32eb692253
commit 53c3fdc1ba
+5
View File
@@ -74,6 +74,11 @@ void PercentageDisplay::Load( const PlayerState *pPlayerState, const PlayerStage
m_bApplyScoreDisplayOptions = THEME->GetMetricB( sMetricsGroup, "ApplyScoreDisplayOptions" );
m_Format.SetFromExpression( THEME->GetMetric(sMetricsGroup, "Format") );
if( m_Format.IsNil() )
{
LOG->Trace( "Format is nil in [%s]. Defaulting to 'FormatPercentScore'.", sMetricsGroup.c_str() );
m_Format.SetFromExpression( "FormatPercentScore" );
}
if( PREFSMAN->m_bDancePointsForOni )
m_textPercent.SetName( "DancePoints" + PlayerNumberToString(m_pPlayerState->m_PlayerNumber) );