From 08c342e4e7f451bcc620292c476366d309850aca Mon Sep 17 00:00:00 2001 From: akuma06 Date: Wed, 31 May 2017 21:07:56 +0200 Subject: [PATCH] Added a check on LastID function --- router/template_functions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/router/template_functions.go b/router/template_functions.go index acd738be..aa2a9ea5 100644 --- a/router/template_functions.go +++ b/router/template_functions.go @@ -217,7 +217,7 @@ var FuncMap = template.FuncMap{ if sort == "2" || sort == "" { if order { lastID = int(torrents[len(torrents)-1].ID) - } else { + } else if len(torrents) > 0 { lastID = int(torrents[0].ID) } }