diff --git a/src/View/GeoTIFF/Window.py b/src/View/GeoTIFF/Window.py index d428ea30..d57de56f 100644 --- a/src/View/GeoTIFF/Window.py +++ b/src/View/GeoTIFF/Window.py @@ -16,7 +16,7 @@ # -*- coding: utf-8 -*- -from tools import trace, timer +from tools import trace, timer, logger_exception from PyQt5.QtWidgets import ( QAction, QListView, QVBoxLayout, @@ -134,7 +134,10 @@ class GeoTIFFListWindow(PamhyrWindow): def _update_rectangle(self): for rect in self._plot_rect: - rect.remove() + try: + rect.remove() + except Exception as e: + logger_exception(e) self._plot_rect = [] diff --git a/src/View/Results/PlotXY.py b/src/View/Results/PlotXY.py index b4618079..91cad26c 100644 --- a/src/View/Results/PlotXY.py +++ b/src/View/Results/PlotXY.py @@ -20,7 +20,7 @@ import logging from functools import reduce -from tools import timer, trace +from tools import timer, trace, logger_exception from View.Tools.PamhyrPlot import PamhyrPlot import numpy as np from matplotlib import collections @@ -332,7 +332,10 @@ class PlotXY(PamhyrPlot): lst = self._data[0]._study.river._geotiff.lst for img in self._plot_img: - self._plot_img[img].remove() + try: + self._plot_img[img].remove() + except Exception as e: + logger_exception(e) self._plot_img = {}