From f93735755be0926a497418e1ecfd07e3af7870f5 Mon Sep 17 00:00:00 2001 From: Steffen Baranowsky Date: Sat, 11 Feb 2017 18:58:06 +0100 Subject: [PATCH] fix crash on export per command line with sample track (#3341) --- src/tracks/SampleTrack.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/tracks/SampleTrack.cpp b/src/tracks/SampleTrack.cpp index f754a2513..e699fb7bf 100644 --- a/src/tracks/SampleTrack.cpp +++ b/src/tracks/SampleTrack.cpp @@ -74,7 +74,10 @@ SampleTCO::SampleTCO( Track * _track ) : //care about positionmarker TimeLineWidget * timeLine = Engine::getSong()->getPlayPos( Engine::getSong()->Mode_PlaySong ).m_timeLine; - connect( timeLine, SIGNAL( positionMarkerMoved() ), this, SLOT( playbackPositionChanged() ) ); + if( timeLine ) + { + connect( timeLine, SIGNAL( positionMarkerMoved() ), this, SLOT( playbackPositionChanged() ) ); + } //care about loops connect( Engine::getSong(), SIGNAL( updateSampleTracks() ), this, SLOT( playbackPositionChanged() ) ); //care about mute TCOs @@ -84,7 +87,10 @@ SampleTCO::SampleTCO( Track * _track ) : //care about TCO position connect( this, SIGNAL( positionChanged() ), this, SLOT( updateTrackTcos() ) ); //playbutton clicked or space key - connect( gui->songEditor(), SIGNAL( playTriggered() ), this, SLOT( playbackPositionChanged() ) ); + if( gui ) + { + connect( gui->songEditor(), SIGNAL( playTriggered() ), this, SLOT( playbackPositionChanged() ) ); + } switch( getTrack()->trackContainer()->type() ) {