From fb93a9e26e4a547f0585da215fdd80076a1e0bee Mon Sep 17 00:00:00 2001 From: lwnmengjing Date: Fri, 1 Dec 2023 11:11:23 +0800 Subject: [PATCH] :bug: fix: controller (#68) --- pkg/response/controller/simple.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/response/controller/simple.go b/pkg/response/controller/simple.go index a093d7b..cbdc0f0 100644 --- a/pkg/response/controller/simple.go +++ b/pkg/response/controller/simple.go @@ -37,6 +37,9 @@ func NewSimple(options ...Option) *Simple { // Path route path func (e *Simple) Path() string { + if e.options.model == nil { + return "" + } return strings.ReplaceAll(strings.ToLower(mgm.CollName(e.options.model)), "_", "-") }