Minor fix in model helpers

This commit is contained in:
adragusin
2020-07-16 18:57:07 +03:00
committed by Dan Christian Bogos
parent c6aeb16a7e
commit c23e534d70

View File

@@ -1817,7 +1817,7 @@ func (tps TpFilterS) AsTPFilter() (result []*utils.TPFilterProfile) {
}
func APItoModelTPFilter(th *utils.TPFilterProfile) (mdls TpFilterS) {
if len(th.Filters) == 0 {
if th == nil || len(th.Filters) == 0 {
return
}
for _, fltr := range th.Filters {