Skip to content

Commit

Permalink
fix #54 again
Browse files Browse the repository at this point in the history
  • Loading branch information
orzogc committed Jul 15, 2023
1 parent 2b1f16c commit 58f9eb7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,15 @@ func createDir(pid uint64, name string) (cid uint64, e error) {
query.Set("search_value", name)
reqURL.RawQuery = query.Encode()
v, err := getURLJSON(reqURL.String())
checkErr(err)
cid, err = findDir(v, pid, name)
// 请求有可能返回空body
if err == nil {
return cid, nil
cid, err = findDir(v, pid, name)
if err == nil {
return cid, nil
}
}
if *verbose {
log.Printf("搜索文件夹失败,改为直接查找文件夹:%v", err)
}

// 如果搜索的文件夹不存在,就直接查找
Expand Down

0 comments on commit 58f9eb7

Please sign in to comment.