From c0093b16c408fc5edb787c9660553cf488a63d68 Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Thu, 1 Oct 2015 18:06:12 +0200 Subject: [PATCH] =?UTF-8?q?Fixing=20crash=20on=20230=E2=80=A6blablabla?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gserver/webapp.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gserver/webapp.go b/gserver/webapp.go index 4a87b7a..15f613e 100644 --- a/gserver/webapp.go +++ b/gserver/webapp.go @@ -148,8 +148,8 @@ func GetLEpisode(c *gin.Context) { database.Db.Model(&LP).Related(&AT) var DEP []gin.H for _, EP := range EPs { - if len(EP.Descr.String) > 230 { - ints := []rune(EP.Descr.String) + ints := []rune(EP.Descr.String) + if len(ints) > 230 { EP.Descr.String = string(ints[:230]) + "…" } DEP = append(DEP, gin.H{"EP": EP, "LP": LP,}) @@ -169,8 +169,8 @@ func GetLEpisode(c *gin.Context) { database.Db.Model(&LP).Related(&AT) var DEP []gin.H for _, EP := range EPs { - if len(EP.Descr.String) > 230 { - ints := []rune(EP.Descr.String) + ints := []rune(EP.Descr.String) + if len(ints) > 230 { EP.Descr.String = string(ints[:230]) + "…" } DEP = append(DEP, gin.H{"EP": EP, "LP": LP,})