Commit 64b3494c authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch '320836-display-compare-button' into 'master'

Add optional chaining when data is undefined

See merge request gitlab-org/gitlab!54371
parents 3eacba32 ff13911d
...@@ -65,8 +65,8 @@ export default { ...@@ -65,8 +65,8 @@ export default {
return axios return axios
.get(endpoint) .get(endpoint)
.then(({ data }) => { .then(({ data }) => {
this.branches = data.Branches; this.branches = data.Branches || [];
this.tags = data.Tags; this.tags = data.Tags || [];
}) })
.catch(() => { .catch(() => {
createFlash({ createFlash({
......
---
title: Safe guard repo compare when data is undefined
merge_request: 54371
author:
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment