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 26, 2023
1 parent 710bbdd commit 71a3fe8
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 @@ -397,7 +397,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 @@ -127,7 +127,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 71a3fe8

Please sign in to comment.