Skip to content

Commit

Permalink
Perform None check for group in update_group (#4255)
Browse files Browse the repository at this point in the history
* Perform None check for group in update_group

incident.tactical_group can be None and if that is the case, this will handle it by ignoring and just log a warning.

* whitespace

fixed whitespace issue
  • Loading branch information
jschroth authored Jan 17, 2024
1 parent 52f0c1c commit 3e649cd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/dispatch/group/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ def update_group(
db_session: SessionLocal,
):
"""Updates an existing group."""
if group is None:
log.warning(f"Group not updated. No group provided. Cannot {group_action} for {group_member}.")
return

plugin = plugin_service.get_active_instance(
db_session=db_session, project_id=subject.project.id, plugin_type="participant-group"
)
Expand Down

0 comments on commit 3e649cd

Please sign in to comment.