File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -941,16 +941,25 @@ export class Repository implements IRemoteRepository {
941941 if ( this . lastPromptAuth ) {
942942 await this . lastPromptAuth ;
943943 }
944- return keytar . findCredentials ( this . getCredentialServiceName ( ) ) ;
944+
945+ try {
946+ return keytar . findCredentials ( this . getCredentialServiceName ( ) ) ;
947+ } catch ( error ) {
948+ return [ ] ;
949+ }
945950 }
946951
947952 public async saveAuth ( ) : Promise < void > {
948953 if ( this . canSaveAuth && this . username && this . password ) {
949- await keytar . setPassword (
950- this . getCredentialServiceName ( ) ,
951- this . username ,
952- this . password
953- ) ;
954+ try {
955+ await keytar . setPassword (
956+ this . getCredentialServiceName ( ) ,
957+ this . username ,
958+ this . password
959+ ) ;
960+ } catch ( error ) {
961+ console . log ( error ) ;
962+ }
954963 this . canSaveAuth = false ;
955964 }
956965 }
You can’t perform that action at this time.
0 commit comments