diff --git a/src/Player.cpp b/src/Player.cpp index 75da9f0ca0..e8fd8ad661 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -1443,15 +1443,20 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector *pVolume = Preference::GetPreferenceByName("SoundVolume"); - float fVol = pVolume->Get(); - - if( tn.iKeysoundIndex >= 0 && tn.iKeysoundIndex < (int) m_vKeysounds.size() ) + if (pVolume != NULL) { - float factor = (tn.subType == TapNote::hold_head_roll ? 2.0f * fLifeFraction : 10.0f * fLifeFraction - 8.5f); - m_vKeysounds[tn.iKeysoundIndex].SetProperty ("Volume", max(0.0f, min(1.0f, factor)) * fVol); + float fVol = pVolume->Get(); + + if( tn.iKeysoundIndex >= 0 && tn.iKeysoundIndex < (int) m_vKeysounds.size() ) + { + float factor = (tn.subType == TapNote::hold_head_roll ? 2.0f * fLifeFraction : 10.0f * fLifeFraction - 8.5f); + m_vKeysounds[tn.iKeysoundIndex].SetProperty ("Volume", max(0.0f, min(1.0f, factor)) * fVol); + } } }