File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -204,12 +204,14 @@ export class GithubBranchProtectionProvider implements BranchProtectionProvider
204
204
205
205
if ( err instanceof AuthenticationError ) {
206
206
// A GitHub authentication session could be missing if the user has not yet
207
- // signed in with their GitHub account or they have signed out. In this case
208
- // we have to clear the branch protection information.
209
- this . branchProtection = branchProtection ;
210
- this . _onDidChangeBranchProtection . fire ( this . repository . rootUri ) ;
207
+ // signed in with their GitHub account or they have signed out. If there is
208
+ // branch protection information we have to clear it.
209
+ if ( this . branchProtection . length !== 0 ) {
210
+ this . branchProtection = branchProtection ;
211
+ this . _onDidChangeBranchProtection . fire ( this . repository . rootUri ) ;
211
212
212
- await this . globalState . update ( this . globalStateKey , undefined ) ;
213
+ await this . globalState . update ( this . globalStateKey , undefined ) ;
214
+ }
213
215
}
214
216
}
215
217
}
You can’t perform that action at this time.
0 commit comments