From 6318f50b59762f1b0e7c8c5ab808271fa9c189ed Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Thu, 14 Jan 2016 15:45:52 +0800 Subject: [PATCH] #264 --- conf/user.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/conf/user.go b/conf/user.go index 2b5a47b..5d4e31a 100644 --- a/conf/user.go +++ b/conf/user.go @@ -108,6 +108,12 @@ func (u *User) Save() bool { return false } + if "" == string(bytes) { + logger.Error("Truncated user [" + u.Name + "]") + + return false + } + if err = ioutil.WriteFile("conf/users/"+u.Name+".json", bytes, 0644); nil != err { logger.Error(err)