Skip to content

Commit

Permalink
🚑 Don't panic when adding a feed/page for the first time
Browse files Browse the repository at this point in the history
Fixes #151
  • Loading branch information
makew0rld committed Dec 21, 2020
1 parent 11148ff commit d7d7c30
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.7.1] - 2020-12-21
### Fixed
- Fixed bug that caused Amfora to crash when subscribing to a page (#151)


## [1.7.0] - 2020-12-20
### Added
- **Subscriptions** to feeds and page changes (#61)
Expand Down
2 changes: 1 addition & 1 deletion amfora.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

var (
version = "v1.7.0"
version = "v1.7.1"
commit = "unknown"
builtBy = "unknown"
)
Expand Down
7 changes: 5 additions & 2 deletions subscriptions/subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,12 @@ func Init() error {
} else if !os.IsNotExist(err) {
// There's an error opening the file, but it's not bc is doesn't exist
return fmt.Errorf("open subscriptions.json error: %w", err)
} else {
// File does not exist, initialize maps
}

if data.Feeds == nil {
data.Feeds = make(map[string]*gofeed.Feed)
}
if data.Pages == nil {
data.Pages = make(map[string]*pageJSON)
}

Expand Down

0 comments on commit d7d7c30

Please sign in to comment.