diff --git a/collections.go b/collections.go index 1a8ceca..d874e3e 100644 --- a/collections.go +++ b/collections.go @@ -211,6 +211,10 @@ func (c *Collection) DisplayCanonicalURL() string { } func (c *Collection) RedirectingCanonicalURL(isRedir bool) string { + if c.hostName == "" { + // If this is true, the human programmers screwed up. So ask for a bug report and fail, fail, fail + log.Error("[PROGRAMMER ERROR] WARNING: Collection.hostName is empty! Federation and many other things will fail! If you're seeing this in the wild, please report this bug and let us know what you were doing just before this: https://github.com/writeas/writefreely/issues/new?template=bug_report.md") + } if isSingleUser { return c.hostName + "/" }