提交 b3dc009e 编写于 作者: Z zhaoke

* Fix panic when site products empty.

上级 932aab29
......@@ -4,9 +4,13 @@ import (
"encoding/json"
"errors"
"fmt"
"path"
"regexp"
"strings"
"github.com/bitly/go-simplejson"
commConsts "github.com/easysoft/zentaoatf/internal/pkg/consts"
"github.com/easysoft/zentaoatf/internal/pkg/domain"
commDomain "github.com/easysoft/zentaoatf/internal/pkg/domain"
configHelper "github.com/easysoft/zentaoatf/internal/pkg/helper/config"
serverDomain "github.com/easysoft/zentaoatf/internal/server/modules/v1/domain"
"github.com/easysoft/zentaoatf/internal/server/modules/v1/model"
......@@ -14,9 +18,6 @@ import (
httpUtils "github.com/easysoft/zentaoatf/pkg/lib/http"
i118Utils "github.com/easysoft/zentaoatf/pkg/lib/i118"
logUtils "github.com/easysoft/zentaoatf/pkg/lib/log"
"path"
"regexp"
"strings"
)
func GetConfig(baseUrl string) (err error) {
......@@ -119,6 +120,9 @@ func LoadSiteProduct(currSite serverDomain.ZentaoSite, currProductId int) (
}
}
if len(products) == 0 {
return
}
currProduct = products[currIndex]
//products[currIndex].Checked = true
......
......@@ -144,7 +144,7 @@ const suites = computed<any[]>(() => store.state.Zentao.suites);
const tasks = computed<any[]>(() => store.state.Zentao.tasks);
const fetchData = () => {
store.dispatch("WorkspaceOld/list", currProduct.value.id);
if(currSite.value.id == undefined || currSite.value.id <= 1) return;
if(currSite.value.id == undefined || currSite.value.id <= 1 || currProduct.value.id == undefined) return;
store.dispatch("Zentao/fetchModules", {
siteId: currSite.value.id,
productId: currProduct.value.id,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册