fix 修复没获取到detail后空指针的bug
Some checks failed
Build image / build (push) Failing after 34s

This commit is contained in:
timerzz 2024-05-05 21:57:14 +08:00
parent f882070b22
commit f85e44d69a

View File

@ -110,6 +110,9 @@ func (c *CoachOutlet) Watch() {
} }
func (c *CoachOutlet) getInventory() bool { func (c *CoachOutlet) getInventory() bool {
if c.detail == nil {
return false
}
// 请求 // 请求
subCtx, cancel := context.WithTimeout(c.ctx, time.Minute*5) subCtx, cancel := context.WithTimeout(c.ctx, time.Minute*5)
inventory, err := c.requestProductInventory(subCtx) inventory, err := c.requestProductInventory(subCtx)