Fix nil dereference bug in entry checkAuthors

This commit is contained in:
Jason Streifling 2024-10-17 04:55:28 +02:00
parent 97fe20f364
commit 2ef8d8c9df

View File

@ -36,6 +36,9 @@ type Entry struct {
// atom:author element itself. // atom:author element itself.
func (e *Entry) checkAuthors() error { func (e *Entry) checkAuthors() error {
if e.Authors == nil { if e.Authors == nil {
if e.Source == nil {
return errors.New("no authors set in entry")
}
if e.Source.Authors == nil { if e.Source.Authors == nil {
return errors.New("no authors set in entry") return errors.New("no authors set in entry")
} }