Skip to content

Commit eb2ff2d

Browse files
authored
fix(189pc/189tv): request panic when login failed (#1428)
1 parent 4153245 commit eb2ff2d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

drivers/189_tv/utils.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ func (y *Cloud189TV) request(url, method string, callback base.ReqCallback, para
7070
}
7171

7272
func (y *Cloud189TV) requestWithRetry(url, method string, callback base.ReqCallback, params map[string]string, resp interface{}, retryCount int, isFamily ...bool) ([]byte, error) {
73+
if y.tokenInfo == nil {
74+
return nil, fmt.Errorf("login failed")
75+
}
7376
req := y.client.R().SetQueryParams(clientSuffix())
7477

7578
if params != nil {

drivers/189pc/utils.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ func (y *Cloud189PC) EncryptParams(params Params, isFamily bool) string {
9090
}
9191

9292
func (y *Cloud189PC) request(url, method string, callback base.ReqCallback, params Params, resp interface{}, isFamily ...bool) ([]byte, error) {
93+
if y.getTokenInfo() == nil {
94+
return nil, fmt.Errorf("login failed")
95+
}
9396
req := y.getClient().R().SetQueryParams(clientSuffix())
9497

9598
// 设置params

0 commit comments

Comments
 (0)