Skip to content

Commit

Permalink
Fix lfs preview bug (#14428) (#14433)
Browse files Browse the repository at this point in the history
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
  • Loading branch information
6543 and lunny authored Jan 23, 2021
1 parent 4d2a6c4 commit dd827d6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion routers/repo/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"encoding/base64"
"fmt"
gotemplate "html/template"
"io"
"io/ioutil"
"net/url"
"path"
Expand Down Expand Up @@ -420,7 +421,9 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st

buf = make([]byte, 1024)
n, err = dataRc.Read(buf)
if err != nil {
// Error EOF don't mean there is an error, it just means we read to
// the end
if err != nil && err != io.EOF {
ctx.ServerError("Data", err)
return
}
Expand Down

0 comments on commit dd827d6

Please sign in to comment.