From 2ef8d8c9df8fe01b64f0641c62b6dbad301eb47e Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Thu, 17 Oct 2024 04:55:28 +0200 Subject: [PATCH] Fix nil dereference bug in entry checkAuthors --- entry.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entry.go b/entry.go index fe8ef3e..69fdca7 100644 --- a/entry.go +++ b/entry.go @@ -36,6 +36,9 @@ type Entry struct { // atom:author element itself. func (e *Entry) checkAuthors() error { if e.Authors == nil { + if e.Source == nil { + return errors.New("no authors set in entry") + } if e.Source.Authors == nil { return errors.New("no authors set in entry") }