Skip to content

Commit d7d7c30

Browse files
committed
πŸš‘ Don't panic when adding a feed/page for the first time
Fixes #151
1 parent 11148ff commit d7d7c30

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.7.1] - 2020-12-21
8+
### Fixed
9+
- Fixed bug that caused Amfora to crash when subscribing to a page (#151)
10+
11+
712
## [1.7.0] - 2020-12-20
813
### Added
914
- **Subscriptions** to feeds and page changes (#61)

β€Žamfora.goβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
)
1212

1313
var (
14-
version = "v1.7.0"
14+
version = "v1.7.1"
1515
commit = "unknown"
1616
builtBy = "unknown"
1717
)

β€Žsubscriptions/subscriptions.goβ€Ž

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,12 @@ func Init() error {
6060
} else if !os.IsNotExist(err) {
6161
// There's an error opening the file, but it's not bc is doesn't exist
6262
return fmt.Errorf("open subscriptions.json error: %w", err)
63-
} else {
64-
// File does not exist, initialize maps
63+
}
64+
65+
if data.Feeds == nil {
6566
data.Feeds = make(map[string]*gofeed.Feed)
67+
}
68+
if data.Pages == nil {
6669
data.Pages = make(map[string]*pageJSON)
6770
}
6871

0 commit comments

Comments
Β (0)