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 @@ -711,21 +711,14 @@ func checkCitationFile(ctx *context.Context, entry *git.TreeEntry) {
711
711
}
712
712
for _ , entry := range allEntries {
713
713
if entry .Name () == "CITATION.cff" || entry .Name () == "CITATION.bib" {
714
- ctx .Data ["CitiationExist" ] = true
715
714
// Read Citation file contents
716
- blob := entry .Blob ()
717
- dataRc , err := blob .DataAsync ()
718
- if err != nil {
719
- ctx .ServerError ("DataAsync" , err )
720
- return
721
- }
722
- defer dataRc .Close ()
723
- ctx .PageData ["citationFileContent" ], err = blob .GetBlobContent (setting .UI .MaxDisplayFileSize )
724
- if err != nil {
725
- ctx .ServerError ("GetBlobContent" , err )
726
- return
715
+ if content , err := entry .Blob ().GetBlobContent (setting .UI .MaxDisplayFileSize ); err != nil {
716
+ log .Error ("checkCitationFile: GetBlobContent: %v" , err )
717
+ } else {
718
+ ctx .Data ["CitiationExist" ] = true
719
+ ctx .PageData ["citationFileContent" ] = content
720
+ break
727
721
}
728
- break
729
722
}
730
723
}
731
724
}
You can’t perform that action at this time.
0 commit comments