You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

当查询不到数据时,item变量为nil,此时会触发BUG

exception recovered: runtime error: invalid memory address or nil pointer dereference

其中的resourceV1.GetTemplateRes结构体的定义如下:

将代码改为如下即可解决问题,相当于增加了一个if判断:



  • No labels