[dbmanager] Fixes #13679 - QGIS master crashes when closing DB Manager in preview mode

This commit is contained in:
Salvatore Larosa 2016-01-27 09:24:17 +01:00
parent 602437aa06
commit 47013f7bef

View File

@ -54,10 +54,12 @@ class LayerPreview(QgsMapCanvas):
def loadPreview(self, item):
if item == self.item and not self.dirty:
return
self._clear()
if item is None:
return
self._clear()
if isinstance(item, Table) and item.type in [Table.VectorType, Table.RasterType]:
# update the preview, but first let the manager chance to show the canvas
runPrev = lambda: self._loadTablePreview(item)