Commit 4079c047 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Clip: Fixed crash when parent media isn't found

This was clearly not a good way of checking for the existance of an
element in a QHash...
parent adc0ea5a
......@@ -203,13 +203,19 @@ MediaContainer::load( const QDomElement &clips, MediaContainer *parentMC )
if ( clip.hasAttribute( "media" ) == true )
{
QString media = clip.attribute( "media" );
Media* m = m_medias[media];
if ( m != NULL )
if ( m_medias.contains( media ) == true )
{
Media* m = m_medias[media];
c = new Clip( m, 0, -1, uuid );
m->setBaseClip( c );
addClip( c );
}
else
{
qWarning() << "Can't find parent media:" << media;
clip = clip.nextSibling().toElement();
continue ;
}
}
else
{
......
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