From 4b259a8137758a5f2e4004bd8a57b81cc175864f Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Wed, 20 Oct 2021 08:43:38 +1100 Subject: [PATCH] fix: null safe navigation in case a branch head does not exist for a branch version --- lib/pact_broker/versions/branch_version.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pact_broker/versions/branch_version.rb b/lib/pact_broker/versions/branch_version.rb index a1febb4e9..797c4851f 100644 --- a/lib/pact_broker/versions/branch_version.rb +++ b/lib/pact_broker/versions/branch_version.rb @@ -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