Skip to content

Commit

Permalink
models.file:File.action_data - ensure it is never None
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoCampinoti94 authored Jun 27, 2024
1 parent e580f9e commit 572647a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions acacore/models/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class File(BaseModel):
signature: str | None
warning: list[str] | None = None
action: TActionType | None = DBField(index=["idx_action"])
action_data: ActionData | None = None
action_data: ActionData = ActionData()
processed: bool = False
lock: bool = False
root: Path | None = DBField(None, ignore=True)
Expand Down Expand Up @@ -269,7 +269,7 @@ def get_action(
action: Action | None = reduce(lambda acc, cur: acc or actions.get(cur), identifiers, None)

if set_match:
self.action, self.action_data = action.action if action else None, action.action_data if action else None
self.action, self.action_data = action.action if action else None, action.action_data if action else ActionData()

return action

Expand Down

0 comments on commit 572647a

Please sign in to comment.