Skip to content
Permalink
Browse files

do not store recursively

this avoids having an endless loop -> crash
  • Loading branch information
signedav committed Sep 13, 2018
1 parent 23f1e43 commit f7f36cdafa844db4cf4a7a5cff5a39a5b3cc4250
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/gui/editorwidgets/qgsrelationwidgetwrapper.cpp
@@ -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;

0 comments on commit f7f36cd

Please sign in to comment.
You can’t perform that action at this time.