Skip to content

Commit

Permalink
do not raise error in processing algoirthm if map tool previously used
Browse files Browse the repository at this point in the history
by the canvas was destroyed (fix #53294)
  • Loading branch information
alexbruy authored and nyalldawson committed Jun 7, 2023
1 parent 6255547 commit a84011e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion python/plugins/processing/ProcessingPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,10 @@ def executeAlgorithm(self, alg_id, parent, in_place=False, as_batch=False):
canvas.mapTool().reset()
except Exception:
pass
canvas.setMapTool(prevMapTool)
try:
canvas.setMapTool(prevMapTool)
except RuntimeError:
pass
else:
feedback = MessageBarProgress(algname=alg.displayName())
context = dataobjects.createContext(feedback)
Expand Down
5 changes: 4 additions & 1 deletion python/plugins/processing/gui/AlgorithmLocatorFilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ def triggerResult(self, result):
canvas.mapTool().reset()
except:
pass
canvas.setMapTool(prevMapTool)
try:
canvas.setMapTool(prevMapTool)
except RuntimeError:
pass


class InPlaceAlgorithmLocatorFilter(QgsLocatorFilter):
Expand Down

0 comments on commit a84011e

Please sign in to comment.