fix to empty list

This commit is contained in:
YouROK
2021-05-26 11:01:11 +03:00
parent aa1c473920
commit 5aa2fef289

View File

@@ -136,7 +136,7 @@ func remTorrent(req torrReqJS, c *gin.Context) {
func listTorrent(req torrReqJS, c *gin.Context) { func listTorrent(req torrReqJS, c *gin.Context) {
list := torr.ListTorrent() list := torr.ListTorrent()
if list == nil { if len(list) == 0 {
c.JSON(200, []*state.TorrentStatus{}) c.JSON(200, []*state.TorrentStatus{})
return return
} }