From cc8af2e7dc6d71054e31a5de371a53615dfcd9b1 Mon Sep 17 00:00:00 2001 From: "chris.lu@gmail.com" Date: Thu, 22 Dec 2011 19:55:13 +0000 Subject: [PATCH] print error message if invalid file id is used git-svn-id: https://weed-fs.googlecode.com/svn/trunk@21 282b0af5-e82d-9cf1-ede4-77906d7719d0 --- weed-fs/src/cmd/weedc.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/weed-fs/src/cmd/weedc.go b/weed-fs/src/cmd/weedc.go index 6b8800d23..b2e9dda39 100644 --- a/weed-fs/src/cmd/weedc.go +++ b/weed-fs/src/cmd/weedc.go @@ -45,6 +45,10 @@ func GetHandler(w http.ResponseWriter, r *http.Request) { if dotIndex > 0 { fid = path[commaIndex+1 : dotIndex] } + if commaIndex <= 0 { + log.Println("unknown file id", path[sepIndex+1 : commaIndex]) + return + } volumeId, _ := strconv.Atoui64(path[sepIndex+1 : commaIndex]) n.ParsePath(fid)