Skip to content
Permalink
Browse files

Merge pull request #5936 from elpaso/bugfix-17724-virtuallayer-crash

[bugfix] Fix crash in virtual layers dlg when adding
  • Loading branch information
elpaso committed Dec 22, 2017
2 parents 224dcd0 + 385d0ef commit 02152ac8f3badc69b85fa95b092d6f9af5bf6d61
Showing with 11 additions and 6 deletions.
  1. +11 −6 src/providers/virtual/qgsvirtuallayersourceselect.cpp
@@ -374,13 +374,18 @@ void QgsVirtualLayerSourceSelect::addButtonClicked()
}
}
}
if ( replace )
{
emit replaceVectorLayer( id, def.toString(), layerName, QStringLiteral( "virtual" ) );
}
else
// This check is to prevent a crash, a proper implementation should handle
// the Add button state when a virtual layer definition is available
if ( ! def.toString().isEmpty() )
{
emit addVectorLayer( def.toString(), layerName );
if ( replace )
{
emit replaceVectorLayer( id, def.toString(), layerName, QStringLiteral( "virtual" ) );
}
else
{
emit addVectorLayer( def.toString(), layerName );
}
}
if ( widgetMode() == QgsProviderRegistry::WidgetMode::None )
{

0 comments on commit 02152ac

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