protondrive: handle the empty credential case when reading from the config cache

This commit is contained in:
Chun-Hung Tseng 2023-09-11 17:33:33 +02:00
parent 77f7bb08af
commit d01d57e62f

View File

@ -271,18 +271,34 @@ func getConfigMap(m configmap.Mapper) (uid, accessToken, refreshToken, saltedKey
if accessToken, ok = m.Get(clientAccessTokenKey); !ok {
return
}
if len(accessToken) == 0 {
ok = false
return
}
if uid, ok = m.Get(clientUIDKey); !ok {
return
}
if len(uid) == 0 {
ok = false
return
}
if refreshToken, ok = m.Get(clientRefreshTokenKey); !ok {
return
}
if len(refreshToken) == 0 {
ok = false
return
}
if saltedKeyPass, ok = m.Get(clientSaltedKeyPassKey); !ok {
return
}
if len(saltedKeyPass) == 0 {
ok = false
return
}
_saltedKeyPass = saltedKeyPass
return