Skip to content

Commit

Permalink
raise an assert if algorithm which should be added to the toolbar is …
Browse files Browse the repository at this point in the history
…not found
  • Loading branch information
alexbruy committed Aug 17, 2020
1 parent 97e9754 commit de7de1e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions python/plugins/processing/gui/menus.py
Expand Up @@ -291,8 +291,7 @@ def findAction(actions, alg):
def addToolBarButton(algId, toolbar, icon=None, tooltip=None):
alg = QgsApplication.processingRegistry().algorithmById(algId)
if alg is None or alg.id() != algId:
QgsMessageLog.logMessage(Processing.tr('Invalid algorithm ID for button: {}').format(algId), Processing.tr('Processing'))
return
assert False, algId

if tooltip is None:
if (QgsGui.higFlags() & QgsGui.HigMenuTextIsTitleCase) and not (alg.flags() & QgsProcessingAlgorithm.FlagDisplayNameIsLiteral):
Expand Down

0 comments on commit de7de1e

Please sign in to comment.