---
db/db.go | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/db/db.go b/db/db.go
index 6b9af47..28d2c71 100644
--- a/db/db.go
+++ b/db/db.go
@@ -228,7 +228,11 @@ func (s *Storage) DeleteFeed(url string) error {
}
defer db.Close()
- items := s.Feeds[url].Items
+ feed, ok := s.Feeds[url]
+ if !ok {
+ return fmt.Errorf("Feed does not exist")
+ }
+ items := feed.Items
for _, key := range items {
// Delete from item database
if err := db.Update(func(tx *bolt.Tx) error {
--
2.27.0