Do not try to read action values if the ID does not exist

This commit is contained in:
Cédric Krier committed 2023-12-17 22:57:20 +01:00
1 parent 3d3ffc5c7c
commit 1c0ff8eec2
1 file changed
+3 -2
+3 -2
View File
@@ -150,8 +150,9 @@ class Action(DeactivableMixin, ModelSQL, ModelView):
return actions
def get_action_value(self):
return self.get_action_values(
self.type, [self.get_action_id(self.id)])[0]
action_id = self.get_action_id(self.id)
if action_id is not None:
return self.get_action_values(self.type, [action_id])[0]
class ActionKeyword(ModelSQL, ModelView):