Unverified Commit a38c2c06 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Avoid crash in case output directory is not set by the user.

parent 0aa41dc1
......@@ -109,6 +109,7 @@ class EnPTAlgorithm(_EnPTBaseAlgorithm):
)
# list output dir
if 'output_dir' in parameters:
outdir = parameters['output_dir']
outraster_matches = glob(os.path.join(outdir, '*', '*SPECTRAL_IMAGE.GEOTIFF'))
outraster = outraster_matches[0] if len(outraster_matches) > 0 else None
......@@ -129,3 +130,9 @@ class EnPTAlgorithm(_EnPTBaseAlgorithm):
# self.P_OUTPUT_FILE: parameters[self.P_OUTPUT_RASTER],
self.P_OUTPUT_FOLDER: outdir
}
else:
feedback.pushInfo('The output was skipped according to user setting.')
# return outputs
return {'success': True}
......@@ -195,6 +195,7 @@ class ExternalEnPTAlgorithm(_EnPTBaseAlgorithm):
env=enpt_env)
# list output dir
if 'output_dir' in parameters:
outdir = parameters['output_dir']
outraster_matches = glob(os.path.join(outdir, '*', '*SPECTRAL_IMAGE.GEOTIFF'))
outraster = outraster_matches[0] if len(outraster_matches) > 0 else None
......@@ -215,3 +216,9 @@ class ExternalEnPTAlgorithm(_EnPTBaseAlgorithm):
# self.P_OUTPUT_FILE: parameters[self.P_OUTPUT_RASTER],
self.P_OUTPUT_FOLDER: outdir
}
else:
feedback.pushInfo('The output was skipped according to user setting.')
# return outputs
return {'success': True}
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