From 87183c0551fe10e9ef96aa15e6c6f425b55bb33d Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 26 May 2005 08:07:42 +0000 Subject: [PATCH] fix deref null Steps --- stepmania/src/EditMenu.cpp | 2 +- stepmania/src/UnlockManager.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/stepmania/src/EditMenu.cpp b/stepmania/src/EditMenu.cpp index 02009f0425..2ca30fc24d 100644 --- a/stepmania/src/EditMenu.cpp +++ b/stepmania/src/EditMenu.cpp @@ -362,7 +362,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row ) else { Steps *pSteps = GetSelectedSong()->GetStepsByDifficulty( GetSelectedStepsType(), dc ); - if( UNLOCKMAN->StepsIsLocked( GetSelectedSong(), pSteps ) ) + if( pSteps && UNLOCKMAN->StepsIsLocked( GetSelectedSong(), pSteps ) ) pSteps = NULL; switch( EDIT_MODE.GetValue() ) diff --git a/stepmania/src/UnlockManager.cpp b/stepmania/src/UnlockManager.cpp index e68e171664..e36a2ef0fb 100644 --- a/stepmania/src/UnlockManager.cpp +++ b/stepmania/src/UnlockManager.cpp @@ -148,6 +148,7 @@ const UnlockEntry *UnlockManager::FindSong( const Song *pSong ) const const UnlockEntry *UnlockManager::FindSteps( const Song *pSong, const Steps *pSteps ) const { + ASSERT( pSong && pSteps ); FOREACH_CONST( UnlockEntry, m_UnlockEntries, e ) if( e->m_pSong == pSong && e->m_dc == pSteps->GetDifficulty() ) return &(*e);