We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 55add8a commit d330144Copy full SHA for d330144
routers/repo/editor.go
@@ -106,6 +106,7 @@ func editFile(ctx *context.Context, isNewFile bool) {
106
ctx.NotFound("blob.Data", err)
107
return
108
}
109
+
110
defer dataRc.Close()
111
112
ctx.Data["FileSize"] = blob.Size()
@@ -122,6 +123,10 @@ func editFile(ctx *context.Context, isNewFile bool) {
122
123
124
125
d, _ := ioutil.ReadAll(dataRc)
126
+ if err := dataRc.Close(); err != nil {
127
+ log.Error("Error whilst closing blob data: %v", err)
128
+ }
129
130
buf = append(buf, d...)
131
if content, err := charset.ToUTF8WithErr(buf); err != nil {
132
log.Error("ToUTF8WithErr: %v", err)
0 commit comments