Commit dd6a7ec1 authored by Phil Hughes's avatar Phil Hughes

🐛 fix bug where currentBranch would actually be null

parent 9dce759f
......@@ -23,7 +23,7 @@ export default {
},
},
mounted() {
if (!this.currentBranch.can_push) {
if (this.currentBranch && !this.currentBranch.can_push) {
this.updateCommitAction(consts.COMMIT_TO_NEW_BRANCH);
} else if (this.disableMergeRequestRadio) {
this.updateCommitAction(consts.COMMIT_TO_CURRENT_BRANCH);
......@@ -45,7 +45,7 @@ export default {
<div class="append-bottom-15 ide-commit-radios">
<radio-group
:value="$options.commitToCurrentBranch"
:disabled="!currentBranch.can_push"
:disabled="currentBranch && !currentBranch.can_push"
:title="$options.currentBranchPermissionsTooltip"
>
<span
......
......@@ -88,7 +88,7 @@ export const lastCommit = (state, getters) => {
};
export const currentBranch = (state, getters) =>
getters.currentProject.branches[state.currentBranchId];
getters.currentProject && getters.currentProject.branches[state.currentBranchId];
// prevent babel-plugin-rewire from generating an invalid default during karma tests
export default () => {};
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