Skip to content

Commit d2c515e

Browse files
committed
fix
1 parent 18e755c commit d2c515e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

routers/web/repo/view.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -711,11 +711,12 @@ func checkCitationFile(ctx *context.Context, entry *git.TreeEntry) {
711711
}
712712
for _, entry := range allEntries {
713713
if entry.Name() == "CITATION.cff" || entry.Name() == "CITATION.bib" {
714-
ctx.Data["CitiationExist"] = true
715714
// Read Citation file contents
716-
ctx.PageData["citationFileContent"], err = entry.Blob().GetBlobContent(setting.UI.MaxDisplayFileSize)
717-
if err != nil {
715+
if content, err := entry.Blob().GetBlobContent(setting.UI.MaxDisplayFileSize); err != nil {
718716
log.Error("checkCitationFile: GetBlobContent: %v", err)
717+
} else {
718+
ctx.Data["CitiationExist"] = true
719+
ctx.PageData["citationFileContent"] = content
719720
}
720721
break
721722
}

0 commit comments

Comments
 (0)