mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
fix Cannot read property length of null when first init
This commit is contained in:
@@ -116,6 +116,10 @@ func GetSpiderList(filter interface{}, skip int, limit int) ([]Spider, int, erro
|
||||
return spiders, 0, err
|
||||
}
|
||||
|
||||
if spiders == nil {
|
||||
spiders = []Spider{}
|
||||
}
|
||||
|
||||
// 遍历爬虫列表
|
||||
for i, spider := range spiders {
|
||||
// 获取最后一次任务
|
||||
|
||||
@@ -274,7 +274,7 @@ export default {
|
||||
// 爬虫列表
|
||||
request.get('/spiders', {})
|
||||
.then(response => {
|
||||
this.spiderList = response.data.data.list
|
||||
this.spiderList = response.data.data.list || []
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user