Skip to content

Commit

Permalink
[Processing] Fix exception when producing a csv output.
Browse files Browse the repository at this point in the history
Previously "name" was not defined.
  • Loading branch information
radosuav authored and nyalldawson committed Aug 14, 2018
1 parent 9241e2d commit 1644ea3
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions python/plugins/processing/gui/Postprocessing.py
Expand Up @@ -60,7 +60,8 @@ def handleAlgorithmResults(alg, progress=None, showResults=True):
progress.setPercentage(100 * i / float(len(alg.outputs)))
if out.hidden or not out.open:
continue
if isinstance(out, (OutputRaster, OutputVector, OutputTable)):
if isinstance(out, (OutputRaster, OutputVector, OutputTable)) or \
(isinstance(out, OutputFile) and out.ext == 'csv'):
try:
if hasattr(out, "layer") and out.layer is not None:
out.layer.setLayerName(out.description)
Expand All @@ -80,15 +81,6 @@ def handleAlgorithmResults(alg, progress=None, showResults=True):
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
"Error loading result layer:\n" + traceback.format_exc())
wrongLayers.append(out.description)
elif isinstance(out, OutputFile) and out.ext == 'csv':
try:
dataobjects.load(out.value, name, alg.crs,
RenderingStyles.getStyle(alg.commandLineName(),
out.name))
except Exception:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
"Error loading result layer:\n" + traceback.format_exc())
wrongLayers.append(out.description)
elif isinstance(out, OutputHTML):
ProcessingResults.addResult(out.description, out.value)
htmlResults = True
Expand Down

0 comments on commit 1644ea3

Please sign in to comment.