diff --git a/CHANGELOG.md b/CHANGELOG.md index 1165507..c42a01a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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.2] - 2020-12-21 +### Fixed +- Viewing subscriptions after subscribing to a certain user page won't crash Amfora (#157) + + ## [1.7.1] - 2020-12-21 ### Fixed - Fixed bug that caused Amfora to crash when subscribing to a page (#151) diff --git a/amfora.go b/amfora.go index 6e5b80b..09bbbc5 100644 --- a/amfora.go +++ b/amfora.go @@ -11,7 +11,7 @@ import ( ) var ( - version = "v1.7.1" + version = "v1.7.2" commit = "unknown" builtBy = "unknown" ) diff --git a/subscriptions/entries.go b/subscriptions/entries.go index 5e45f10..5281af5 100644 --- a/subscriptions/entries.go +++ b/subscriptions/entries.go @@ -112,14 +112,14 @@ func GetPageEntries() *PageEntries { // Path is title title := parsed.Path - if strings.HasPrefix(title, "/~") { + if strings.HasPrefix(title, "/~") && title != "/~" { // A user dir title = title[2:] // Remove beginning slash and tilde // Remove trailing slash if the root of a user dir is being tracked if strings.Count(title, "/") <= 1 && title[len(title)-1] == '/' { title = title[:len(title)-1] } - } else if strings.HasPrefix(title, "/users/") { + } else if strings.HasPrefix(title, "/users/") && title != "/users/" { // "/users/" is removed for aesthetics when tracking hosted users title = strings.TrimPrefix(title, "/users/") title = strings.TrimPrefix(title, "~") // Remove leading tilde