1
0
mirror of https://github.com/makew0rld/amfora.git synced 2024-09-19 22:25:55 -04:00

🚑 Don't panic when adding a feed/page for the first time

Fixes #151
This commit is contained in:
makeworld 2020-12-21 12:42:43 -05:00
parent 11148ff95c
commit d7d7c3054e
3 changed files with 11 additions and 3 deletions

View File

@ -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)

View File

@ -11,7 +11,7 @@ import (
)
var (
version = "v1.7.0"
version = "v1.7.1"
commit = "unknown"
builtBy = "unknown"
)

View File

@ -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)
}