~chrisppy/beagles-devel

Check if feed exists when attempting delete v1 APPLIED

Will Tiffany: 1
 Check if feed exists when attempting delete

 1 files changed, 5 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~chrisppy/beagles-devel/patches/11659/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] Check if feed exists when attempting delete Export this patch

---
 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
Thanks Will.  Just make sure to run make check before sending next time.