Skip to content

Commit

Permalink
Merge pull request #30794 from qgis/backport-30391-to-release-3_8
Browse files Browse the repository at this point in the history
[Backport release-3_8] Raise an exception when geometry field autodetection has failed
  • Loading branch information
rldhont committed Jul 18, 2019
2 parents f08b953 + 54f95a0 commit 0a6043e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/qgis/ExecuteSQL.py
Expand Up @@ -152,6 +152,9 @@ def processAlgorithm(self, parameters, context, feedback):
if not vLayer.isValid():
raise QgsProcessingException(vLayer.dataProvider().error().message())

if vLayer.wkbType() == QgsWkbTypes.Unknown:
raise QgsProcessingException(self.tr("Cannot find geometry field"))

(sink, dest_id) = self.parameterAsSink(parameters, self.OUTPUT, context,
vLayer.fields(), vLayer.wkbType() if geometry_type != 1 else 1, vLayer.crs())
if sink is None:
Expand Down

0 comments on commit 0a6043e

Please sign in to comment.