Skip to content
Permalink
Browse files

Fix optional None input parameters handling

  • Loading branch information
Médéric RIBREUX
Médéric RIBREUX committed Dec 26, 2017
1 parent 5321ee5 commit 433d376c8ae78204c83848da392b1029b7fbc7b3
Showing with 6 additions and 1 deletion.
  1. +6 −1 python/plugins/processing/algs/grass7/Grass7Algorithm.py
@@ -409,8 +409,12 @@ def processInputs(self, parameters, context):
paramName = param.name()
if not paramName in parameters:
continue
if isinstance(parameters[paramName], str) and len(parameters[paramName]) == 0:
# Handle Null parameter
if parameters[paramName] is None:
continue
elif isinstance(parameters[paramName], str) and len(parameters[paramName]) == 0:
continue

# Raster inputs needs to be imported into temp GRASS DB
if isinstance(param, QgsProcessingParameterRasterLayer):
if paramName not in self.exportedLayers:
@@ -622,6 +626,7 @@ def loadRasterLayerFromParameter(self, name, parameters, context, external=True,
:param band: imports only specified band. None for all bands.
"""
layer = self.parameterAsRasterLayer(parameters, name, context)
QgsMessageLog.logMessage('raster: {0}'.format(name), 'DEBUG', QgsMessageLog.INFO)
self.loadRasterLayer(name, layer, external, band)

def loadRasterLayer(self, name, layer, external=True, band=1):

0 comments on commit 433d376

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