File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -667,14 +667,17 @@ export class CreatePullRequestViewProvider extends BaseCreatePullRequestViewProv
667667 }
668668
669669 public async setDefaultCompareBranch ( compareBranch : Branch | undefined ) {
670- this . _defaultCompareBranch = compareBranch ! . name ! ;
671- this . model . setCompareBranch ( compareBranch ! . name ) ;
672- this . changeBranch ( compareBranch ! . name ! , false ) . then ( async titleAndDescription => {
670+ if ( ! compareBranch ?. name ) {
671+ return ;
672+ }
673+ this . _defaultCompareBranch = compareBranch . name ;
674+ this . model . setCompareBranch ( compareBranch . name ) ;
675+ this . changeBranch ( compareBranch . name , false ) . then ( async titleAndDescription => {
673676 const params : Partial < CreateParamsNew > = {
674677 defaultTitle : titleAndDescription . title ,
675678 defaultDescription : titleAndDescription . description ,
676- compareBranch : compareBranch ? .name ,
677- defaultCompareBranch : compareBranch ? .name ,
679+ compareBranch : compareBranch . name ,
680+ defaultCompareBranch : compareBranch . name ,
678681 warning : await this . existingPRMessage ( ) ,
679682 } ;
680683 return this . _postMessage ( {
You can’t perform that action at this time.
0 commit comments