diff --git a/rowers/tasks.py b/rowers/tasks.py index aec4f4d6..d39ca012 100644 --- a/rowers/tasks.py +++ b/rowers/tasks.py @@ -1887,13 +1887,16 @@ def handle_makeplot(f1, f2, t, hrdata, plotnr, imagename, t += ' - Power Distribution' fig1 = row.get_power_piechart(t) - if fig1: - canvas = FigureCanvas(fig1) + if fig1 is None: + return 0 - canvas.print_figure('static/plots/' + imagename) - plt.close(fig1) - fig1.clf() - gc.collect() + + canvas = FigureCanvas(fig1) + + canvas.print_figure('static/plots/' + imagename) + plt.close(fig1) + fig1.clf() + gc.collect() return imagename