Skip to content

Commit

Permalink
ensure file key is initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
rwynn committed Nov 20, 2016
1 parent c034865 commit 02a2e3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion monstache.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ func PrepareDataForIndexing(data map[string]interface{}) {

func AddFileContent(session *mgo.Session, op *gtm.Op, configuration *configOptions) (err error) {
var buff bytes.Buffer
op.Data["file"] = ""
writer, db, bucket :=
bufio.NewWriter(&buff),
session.DB(op.GetDatabase()),
Expand All @@ -321,7 +322,6 @@ func AddFileContent(session *mgo.Session, op *gtm.Op, configuration *configOptio
if file.Size() > configuration.MaxFileSize {
infoLog.Printf("file %s md5(%s) exceeds max file size. file content omitted.",
file.Name(), file.MD5())
op.Data["file"] = ""
return
}
}
Expand Down

0 comments on commit 02a2e3f

Please sign in to comment.