Skip to content

Commit

Permalink
db manager: don't consider added layer w/o a dataProvider
Browse files Browse the repository at this point in the history
(cherry picked from commit 28aa9ebdb75eb099b83a3596b3f3c5c6e5c6f591)
  • Loading branch information
jef-n committed Aug 30, 2016
1 parent 46ea229 commit a9464d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/plugins/db_manager/db_manager_plugin.py
Expand Up @@ -78,7 +78,7 @@ def unload(self):
self.dlg.close()

def onLayerWasAdded(self, aMapLayer):
if aMapLayer.dataProvider().name() in ['postgres', 'spatialite', 'oracle']:
if hasattr(aMapLayer, 'dataProvider') and aMapLayer.dataProvider().name() in ['postgres', 'spatialite', 'oracle']:
uri = QgsDataSourceUri(aMapLayer.source())
if re.search('^\(SELECT .+ FROM .+\)$', uri.table(), re.S):
self.iface.legendInterface().addLegendLayerActionForLayer(self.layerAction, aMapLayer)
Expand Down

0 comments on commit a9464d7

Please sign in to comment.