Skip to content

Commit

Permalink
Add check on Action's left
Browse files Browse the repository at this point in the history
  • Loading branch information
nbouziani committed Sep 13, 2023
1 parent 54c35ff commit 1fa8b33
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ufl/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ def __new__(cls, *args, **kw):

# Check trivial case
if left == 0 or right == 0:
if isinstance(left, Zero):
# There is no point in checking the action arguments
# if `left` is a `ufl.Zero` as those objects don't have arguments.
# We can also not reliably determine the `ZeroBaseForm` arguments.
return ZeroBaseForm(())
# Still need to work out the ZeroBaseForm arguments.
new_arguments, _ = _get_action_form_arguments(left, right)
return ZeroBaseForm(new_arguments)
Expand Down

0 comments on commit 1fa8b33

Please sign in to comment.