Skip to content

Commit 113e163

Browse files
committed
[processing][grass] Fix skipped outputs are still added in grass commands
1 parent 526e590 commit 113e163

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

python/plugins/processing/algs/grass7/Grass7Algorithm.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -633,15 +633,16 @@ def processCommand(self, parameters, context, feedback, delOutputs=False):
633633
uniqueBasename = outName + self.uniqueSuffix
634634
command += ' {}={}'.format(outName, uniqueBasename)
635635
else:
636-
# We add an output name to make sure it is unique if the session
637-
# uses this algorithm several times.
638-
#value = self.parameterAsOutputLayer(parameters, outName, context)
639-
uniqueOutputName = outName + self.uniqueSuffix
640-
command += ' {}={}'.format(outName, uniqueOutputName)
641-
642-
# Add output file to exported layers, to indicate that
643-
# they are present in GRASS
644-
self.exportedLayers[outName] = uniqueOutputName
636+
if outName in parameters and parameters[outName] is not None:
637+
# We add an output name to make sure it is unique if the session
638+
# uses this algorithm several times.
639+
#value = self.parameterAsOutputLayer(parameters, outName, context)
640+
uniqueOutputName = outName + self.uniqueSuffix
641+
command += ' {}={}'.format(outName, uniqueOutputName)
642+
643+
# Add output file to exported layers, to indicate that
644+
# they are present in GRASS
645+
self.exportedLayers[outName] = uniqueOutputName
645646

646647
command += ' --overwrite'
647648
self.commands.append(command)

0 commit comments

Comments
 (0)