Commit 8f8632d1 authored by Rashad Kanavath's avatar Rashad Kanavath

emtpy string as not None and can break execution

parent 07086604
......@@ -205,7 +205,7 @@ class OtbAlgorithm(QgsProcessingAlgorithm):
outputPixelType = None
for k, v in parameters.items():
# if value is None for a parameter we don't have any businees with this key
if v is None:
if not v or v is None:
continue
# for 'outputpixeltype' parameter we find the pixeltype string from self.pixelTypes
if k == 'outputpixeltype':
......@@ -258,11 +258,12 @@ class OtbAlgorithm(QgsProcessingAlgorithm):
for out in self.destinationParameterDefinitions():
filePath = self.parameterAsOutputLayer(parameters, out.name(), context)
output_files[out.name()] = filePath
if outputPixelType is not None:
command += ' -{} "{}" "{}"'.format(out.name(), filePath, outputPixelType)
else:
command += ' -{} "{}"'.format(out.name(), filePath)
if filePath:
output_files[out.name()] = filePath
if outputPixelType is not None:
command += ' -{} "{}" "{}"'.format(out.name(), filePath, outputPixelType)
else:
command += ' -{} "{}"'.format(out.name(), filePath)
OtbUtils.executeOtb(command, feedback)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment