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