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

MediaContainer: Avoid potential crash.

parent b527af7e
......@@ -200,7 +200,7 @@ MediaContainer::load( const QDomElement &clips, MediaContainer *parentMC )
QString uuid = clip.attribute( "uuid" );
QString metatags = clip.attribute( "metatags" );
QString notes = clip.attribute( "notes" );
Clip *c;
Clip *c = NULL;
if ( clip.hasAttribute( "media" ) == true )
{
......@@ -236,12 +236,15 @@ MediaContainer::load( const QDomElement &clips, MediaContainer *parentMC )
addClip( c );
}
}
if ( metatags.isEmpty() == false )
c->setMetaTags( metatags.split( ',' ) );
c->setNotes( notes );
QDomElement subClips = clip.firstChildElement( "subClips" );
if ( subClips.isNull() == false )
c->getChilds()->load( subClips, this );
if ( c != NULL )
{
if ( metatags.isEmpty() == false )
c->setMetaTags( metatags.split( ',' ) );
c->setNotes( notes );
QDomElement subClips = clip.firstChildElement( "subClips" );
if ( subClips.isNull() == false )
c->getChilds()->load( subClips, this );
}
clip = clip.nextSiblingElement();
}
}
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