|
@@ -271,22 +271,26 @@ func GetChapterDetail(user user.UserInfo, reportChapterId int) (reportChapterDet
|
|
{
|
|
{
|
|
if reportInfo.HeadResourceId > 0 {
|
|
if reportInfo.HeadResourceId > 0 {
|
|
headResource, tmpErr := smart_report_resource.GetResourceItemById(reportInfo.HeadResourceId)
|
|
headResource, tmpErr := smart_report_resource.GetResourceItemById(reportInfo.HeadResourceId)
|
|
- if tmpErr != nil {
|
|
|
|
|
|
+ if tmpErr != nil && tmpErr != utils.ErrNoRow {
|
|
err = tmpErr
|
|
err = tmpErr
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- reportChapterItem.HeadImg = headResource.ImgURL
|
|
|
|
- reportChapterItem.HeadStyle = headResource.Style
|
|
|
|
|
|
+ if headResource != nil && headResource.ResourceID > 0 {
|
|
|
|
+ reportChapterItem.HeadImg = headResource.ImgURL
|
|
|
|
+ reportChapterItem.HeadStyle = headResource.Style
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
if reportInfo.EndResourceId > 0 {
|
|
if reportInfo.EndResourceId > 0 {
|
|
endResource, tmpErr := smart_report_resource.GetResourceItemById(reportInfo.EndResourceId)
|
|
endResource, tmpErr := smart_report_resource.GetResourceItemById(reportInfo.EndResourceId)
|
|
- if tmpErr != nil {
|
|
|
|
|
|
+ if tmpErr != nil && tmpErr != utils.ErrNoRow {
|
|
err = tmpErr
|
|
err = tmpErr
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- reportChapterItem.EndImg = endResource.ImgURL
|
|
|
|
- reportChapterItem.EndStyle = endResource.Style
|
|
|
|
|
|
+ if endResource != nil && endResource.ResourceID > 0 {
|
|
|
|
+ reportChapterItem.EndImg = endResource.ImgURL
|
|
|
|
+ reportChapterItem.EndStyle = endResource.Style
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|