mirror of
https://github.com/qgis/QGIS.git
synced 2025-11-29 00:06:58 -05:00
Fix optional None input parameters handling
This commit is contained in:
parent
5321ee5ea2
commit
433d376c8a
@ -409,8 +409,12 @@ class Grass7Algorithm(QgsProcessingAlgorithm):
|
|||||||
paramName = param.name()
|
paramName = param.name()
|
||||||
if not paramName in parameters:
|
if not paramName in parameters:
|
||||||
continue
|
continue
|
||||||
if isinstance(parameters[paramName], str) and len(parameters[paramName]) == 0:
|
# Handle Null parameter
|
||||||
|
if parameters[paramName] is None:
|
||||||
continue
|
continue
|
||||||
|
elif isinstance(parameters[paramName], str) and len(parameters[paramName]) == 0:
|
||||||
|
continue
|
||||||
|
|
||||||
# Raster inputs needs to be imported into temp GRASS DB
|
# Raster inputs needs to be imported into temp GRASS DB
|
||||||
if isinstance(param, QgsProcessingParameterRasterLayer):
|
if isinstance(param, QgsProcessingParameterRasterLayer):
|
||||||
if paramName not in self.exportedLayers:
|
if paramName not in self.exportedLayers:
|
||||||
@ -622,6 +626,7 @@ class Grass7Algorithm(QgsProcessingAlgorithm):
|
|||||||
:param band: imports only specified band. None for all bands.
|
:param band: imports only specified band. None for all bands.
|
||||||
"""
|
"""
|
||||||
layer = self.parameterAsRasterLayer(parameters, name, context)
|
layer = self.parameterAsRasterLayer(parameters, name, context)
|
||||||
|
QgsMessageLog.logMessage('raster: {0}'.format(name), 'DEBUG', QgsMessageLog.INFO)
|
||||||
self.loadRasterLayer(name, layer, external, band)
|
self.loadRasterLayer(name, layer, external, band)
|
||||||
|
|
||||||
def loadRasterLayer(self, name, layer, external=True, band=1):
|
def loadRasterLayer(self, name, layer, external=True, band=1):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user