Skip to content

Commit a9464d7

Browse files
committedAug 30, 2016
db manager: don't consider added layer w/o a dataProvider
(cherry picked from commit 28aa9ebdb75eb099b83a3596b3f3c5c6e5c6f591)
1 parent 46ea229 commit a9464d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎python/plugins/db_manager/db_manager_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def unload(self):
7878
self.dlg.close()
7979

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

0 commit comments

Comments
 (0)
Please sign in to comment.