Skip to content

Commit 7f4717a

Browse files
committed
locate illegal folder name (#4)
1 parent 13efcce commit 7f4717a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

main.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"encoding/json"
66
"flag"
77
"fmt"
8-
"github.com/buger/jsonparser"
9-
"github.com/gosuri/uilive"
108
"io/ioutil"
119
"log"
1210
"main/api/restore/upload"
@@ -21,6 +19,9 @@ import (
2119
"strings"
2220
"sync"
2321
"time"
22+
23+
"github.com/buger/jsonparser"
24+
"github.com/gosuri/uilive"
2425
)
2526

2627
var loc Loc
@@ -238,7 +239,8 @@ func botSend(botKey string, iuserID string, initText string) func(string) {
238239
func DirSize(path string) (int64, error) {
239240
var size int64
240241
err := filepath.Walk(path, func(_ string, info os.FileInfo, err error) error {
241-
if !info.IsDir() {
242+
243+
if info != nil && !info.IsDir() {
242244
size += info.Size()
243245
}
244246
return err

0 commit comments

Comments
 (0)