timelines.go
changeset 94 beee0238a82e
parent 92 05c201b548b0
child 98 5d803adfc57e
--- a/timelines.go	Wed Apr 12 23:22:42 2017 +0200
+++ b/timelines.go	Wed Apr 12 23:36:46 2017 +0200
@@ -17,7 +17,11 @@
 	if timeline == "home" || timeline == "public" {
 		endPoint = "timelines/" + timeline
 	} else if strings.HasPrefix(timeline, ":") {
-		endPoint = "timelines/tag/" + timeline
+		hashtag := timeline[1:]
+		if hashtag == "" {
+			return tl, fmt.Errorf("timelines API: empty hashtag")
+		}
+		endPoint = "timelines/tag/" + hashtag
 	} else {
 		return tl, fmt.Errorf("GetTimelines: bad timelines argument")
 	}