Skip to content

Commit

Permalink
do not store recursively
Browse files Browse the repository at this point in the history
this avoids having an endless loop -> crash
  • Loading branch information
signedav committed Sep 13, 2018
1 parent 23f1e43 commit f7f36cd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/gui/editorwidgets/qgsrelationwidgetwrapper.cpp
Expand Up @@ -48,6 +48,19 @@ void QgsRelationWidgetWrapper::setVisible( bool visible )

void QgsRelationWidgetWrapper::aboutToSave()
{
// If this widget is already embedded by the same relation return
const QgsAttributeEditorContext *ctx = &context();
do
{
if ( ( ctx->relation().name() == mRelation.name() && ctx->formMode() == QgsAttributeEditorContext::Embed )
|| ( mNmRelation.isValid() && ctx->relation().name() == mNmRelation.name() ) )
{
return;
}
ctx = ctx->parentContext();
}
while ( ctx );

if ( !mRelation.isValid() || !widget() || !widget()->isVisible() )
return;

Expand Down

0 comments on commit f7f36cd

Please sign in to comment.