Skip to content
Permalink
Browse files

Fix SAGA parameter value check

  • Loading branch information
nyalldawson committed May 28, 2018
1 parent a26ae3c commit e25c81377effba7cb994251edb7507e172dcee42
Showing with 10 additions and 6 deletions.
  1. +10 −6 python/plugins/processing/algs/saga/SagaAlgorithm.py
@@ -414,17 +414,21 @@ def checkParameterValues(self, parameters, context):
supported by SAGA, and that raster layers have the same grid extent
"""
extent = None
layers = []
raster_layer_params = []
for param in self.parameterDefinitions():
if param not in parameters or parameters[param.name()] is None:
continue

if isinstance(param, QgsProcessingParameterRasterLayer):
layers.append(parameters[param.name()])
raster_layer_params.append(param.name())
elif (isinstance(param, QgsProcessingParameterMultipleLayers) and
param.layerType() == QgsProcessing.TypeRaster):
if parameters[param.name()]:
layers.extend(parameters[param.name()])
raster_layer_params.extend(param.name())

for layer_param in raster_layer_params:
layer = self.parameterAsRasterLayer(parameters, layer_param, context)

for layer in layers:
if layer is None or layer == '':
if layer is None:
continue
if layer.bandCount() > 1:
return False, self.tr('Input layer {0} has more than one band.\n'

0 comments on commit e25c813

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