Skip to content

Commit

Permalink
fix: null safe navigation in case a branch head does not exist for a …
Browse files Browse the repository at this point in the history
…branch version
  • Loading branch information
bethesque committed Oct 19, 2021
1 parent 62e0ab2 commit 4b259a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/pact_broker/versions/branch_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def before_save
end

def latest?
branch_head.branch_version_id == id
# Should not be possible, not to have a branch head, but have seen this error in the logs
branch_head&.branch_version_id == id
end

def version_number
Expand Down

0 comments on commit 4b259a8

Please sign in to comment.