Merge branch 'fix-udpate-head-pipeline-method' into 'master'
Fix unexpected exception by failure of finding an actual head pipeline
Closes #56113
See merge request gitlab-org/gitlab-ce!24257
(cherry picked from commit 3ce491c5)
1c248cd4 Fix unexpected exception by failed to find an actual head pipeline