Skip to content

Commit

Permalink
fix(febbox): panic due to slice out of range (#7898 close #7889)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason-Fly authored Jan 30, 2025
1 parent f88fd83 commit d53eecc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/febbox/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package febbox
import (
"encoding/json"
"errors"
"fmt"
"github.com/alist-org/alist/v3/drivers/base"
"github.com/alist-org/alist/v3/internal/op"
"github.com/go-resty/resty/v2"
Expand Down Expand Up @@ -135,6 +136,9 @@ func (d *FebBox) getDownloadLink(id string, ip string) (string, error) {
if err = json.Unmarshal(res, &fileDownloadResp); err != nil {
return "", err
}
if len(fileDownloadResp.Data) == 0 {
return "", fmt.Errorf("can not get download link, code:%d, msg:%s", fileDownloadResp.Code, fileDownloadResp.Msg)
}

return fileDownloadResp.Data[0].DownloadURL, nil
}
Expand Down

0 comments on commit d53eecc

Please sign in to comment.