Commit 44474746 authored by Ludovic Fauvet's avatar Ludovic Fauvet

timeline: avoid potential crash

parent 406f6df8
...@@ -381,8 +381,8 @@ TracksView::moveMediaItem( const QUuid &uuid, unsigned int track, qint64 time ) ...@@ -381,8 +381,8 @@ TracksView::moveMediaItem( const QUuid &uuid, unsigned int track, qint64 time )
void void
TracksView::moveMediaItem( AbstractGraphicsMediaItem *item, QPoint position ) TracksView::moveMediaItem( AbstractGraphicsMediaItem *item, QPoint position )
{ {
static GraphicsTrack *lastKnownTrack = NULL;
GraphicsTrack *track = NULL; GraphicsTrack *track = NULL;
static GraphicsTrack *lastKnownTrack = getTrack( MainWorkflow::VideoTrack, 0 );
QList<QGraphicsItem*> list = items( 0, position.y() ); QList<QGraphicsItem*> list = items( 0, position.y() );
for ( int i = 0; i < list.size(); ++i ) for ( int i = 0; i < list.size(); ++i )
...@@ -397,7 +397,7 @@ TracksView::moveMediaItem( AbstractGraphicsMediaItem *item, QPoint position ) ...@@ -397,7 +397,7 @@ TracksView::moveMediaItem( AbstractGraphicsMediaItem *item, QPoint position )
// use the last known track. // use the last known track.
// This avoids "breaks" when moving a rush // This avoids "breaks" when moving a rush
if ( !lastKnownTrack ) if ( !lastKnownTrack )
lastKnownTrack = getTrack( MainWorkflow::VideoTrack, 0 ); return;
track = lastKnownTrack; track = lastKnownTrack;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment