Merge pull request #30017 from elpaso/bugfix-gh29747-layout-mgr-crashes-copying

Don't crash when copying layout elements
This commit is contained in:
Alessandro Pasotti 2019-05-30 10:36:32 +02:00 committed by GitHub
commit 3885944c59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -339,7 +339,7 @@ void QgsLayoutView::copyItems( const QList<QgsLayoutItem *> &items, QgsLayoutVie
else if ( QgsLayoutFrame *frame = qobject_cast<QgsLayoutFrame *>( item ) ) else if ( QgsLayoutFrame *frame = qobject_cast<QgsLayoutFrame *>( item ) )
{ {
// copy multiframe too // copy multiframe too
if ( !copiedMultiFrames.contains( frame->multiFrame() ) ) if ( frame->multiFrame() && !copiedMultiFrames.contains( frame->multiFrame() ) )
{ {
frame->multiFrame()->writeXml( documentElement, doc, context ); frame->multiFrame()->writeXml( documentElement, doc, context );
copiedMultiFrames.insert( frame->multiFrame() ); copiedMultiFrames.insert( frame->multiFrame() );