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
204204
205205 if ( err instanceof AuthenticationError ) {
206206 // 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 ) ;
211212
212- await this . globalState . update ( this . globalStateKey , undefined ) ;
213+ await this . globalState . update ( this . globalStateKey , undefined ) ;
214+ }
213215 }
214216 }
215217 }
You can’t perform that action at this time.
0 commit comments