File tree 1 file changed +6
-13
lines changed
1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -702,21 +702,14 @@ func checkCitationFile(ctx *context.Context, entry *git.TreeEntry) {
702
702
}
703
703
for _ , entry := range allEntries {
704
704
if entry .Name () == "CITATION.cff" || entry .Name () == "CITATION.bib" {
705
- ctx .Data ["CitiationExist" ] = true
706
705
// Read Citation file contents
707
- blob := entry .Blob ()
708
- dataRc , err := blob .DataAsync ()
709
- if err != nil {
710
- ctx .ServerError ("DataAsync" , err )
711
- return
712
- }
713
- defer dataRc .Close ()
714
- ctx .PageData ["citationFileContent" ], err = blob .GetBlobContent (setting .UI .MaxDisplayFileSize )
715
- if err != nil {
716
- ctx .ServerError ("GetBlobContent" , err )
717
- return
706
+ if content , err := entry .Blob ().GetBlobContent (setting .UI .MaxDisplayFileSize ); err != nil {
707
+ log .Error ("checkCitationFile: GetBlobContent: %v" , err )
708
+ } else {
709
+ ctx .Data ["CitiationExist" ] = true
710
+ ctx .PageData ["citationFileContent" ] = content
711
+ break
718
712
}
719
- break
720
713
}
721
714
}
722
715
}
You can’t perform that action at this time.
0 commit comments