Changeset 5864


Ignore:
Timestamp:
04/07/14 06:59:11 (6 years ago)
Author:
avneesh-singh
Message:

prevented null references from pause recording

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Obi/Obi/ProjectView/TransportBar.cs

    r5863 r5864  
    15551555            MessageBox.Show(ex.ToString()); 
    15561556        } 
     1557 
     1558        if (mRecordingSection != null)//@MonitorContinuously 
     1559        { 
    15571560            mResumeRecordingPhrase = (PhraseNode)mRecordingSection.PhraseChild(mRecordingInitPhraseIndex + mRecordingSession.RecordedAudio.Count - 1); 
    15581561            EmptyNode phraseNextToResumePhrase = null; 
    1559             if (mResumeRecordingPhrase.FollowingNode != null && mResumeRecordingPhrase.FollowingNode is EmptyNode) phraseNextToResumePhrase = (EmptyNode) mResumeRecordingPhrase.FollowingNode; 
     1562            if (mResumeRecordingPhrase.FollowingNode != null && mResumeRecordingPhrase.FollowingNode is EmptyNode) phraseNextToResumePhrase = (EmptyNode)mResumeRecordingPhrase.FollowingNode; 
    15601563 
    15611564            bool playbackEnabledOnSelectionChange = SelectionChangedPlaybackEnabled; 
     
    15671570                if (phraseChildCount != mRecordingSection.PhraseChildCount) 
    15681571                { 
    1569                     if (phraseNextToResumePhrase != null && phraseNextToResumePhrase.PrecedingNode is PhraseNode)  
    1570                         mResumeRecordingPhrase =(PhraseNode) phraseNextToResumePhrase.PrecedingNode; 
    1571                     else if ( mRecordingSection.PhraseChild(mRecordingSection.PhraseChildCount - 1) is PhraseNode ) 
    1572                         mResumeRecordingPhrase =(PhraseNode)  mRecordingSection.PhraseChild(mRecordingSection.PhraseChildCount - 1); 
     1572                    if (phraseNextToResumePhrase != null && phraseNextToResumePhrase.PrecedingNode is PhraseNode) 
     1573                        mResumeRecordingPhrase = (PhraseNode)phraseNextToResumePhrase.PrecedingNode; 
     1574                    else if (mRecordingSection.PhraseChild(mRecordingSection.PhraseChildCount - 1) is PhraseNode) 
     1575                        mResumeRecordingPhrase = (PhraseNode)mRecordingSection.PhraseChild(mRecordingSection.PhraseChildCount - 1); 
    15731576 
    15741577                } 
     
    15791582                MessageBox.Show(ex.ToString()); 
    15801583            } 
     1584         
    15811585            if (!wasMonitoring && mResumeRecordingPhrase != null) mView.SelectFromTransportBar(mResumeRecordingPhrase, null); 
    15821586            SelectionChangedPlaybackEnabled = playbackEnabledOnSelectionChange; 
    1583              
     1587        }// recording section check     
    15841588            mRecordingSession = null; 
    15851589            UpdateTimeDisplay(); 
     
    32763280 
    32773281            // delete the following phrases before going into more complex commands 
    3278             if (mView.ObiForm.Settings.Audio_DeleteFollowingPhrasesOfSectionAfterRecording && listOfRecordedPhrases.Count >0) 
     3282            if (mView.ObiForm.Settings.Audio_DeleteFollowingPhrasesOfSectionAfterRecording && listOfRecordedPhrases != null && listOfRecordedPhrases.Count > 0) 
    32793283            { 
    32803284                EmptyNode lastRecordedPhrase = listOfRecordedPhrases[listOfRecordedPhrases.Count - 1] ; 
     
    32893293 
    32903294            // on the fly phrase detection 
    3291             if (mRecordingSession.PhraseMarksOnTheFly.Count > 0) 
     3295            if (mRecordingSession.PhraseMarksOnTheFly != null && mRecordingSession.PhraseMarksOnTheFly.Count > 0) 
    32923296            { 
    32933297                if (IsPlaying) Pause(); 
Note: See TracChangeset for help on using the changeset viewer.