修复统计结果为空,页面抛异常的bug

This commit is contained in:
ascrutae 2016-05-19 09:03:49 +08:00
parent 2b6273f13c
commit 31df970e92
1 changed files with 5 additions and 1 deletions

View File

@ -79,7 +79,11 @@ AnalysisResultViewResolver.prototype.showTypicalCallTree = function (nodeToken)
for (var key in node.treeNodes) {
var tmpNode = node.treeNodes[key];
tmpNode.anlyResult = JSON.parse($("#" + key).text());
var analyResultStr = $("#" + key).text();
if (analyResultStr == undefined || analyResultStr == "") {
analyResultStr = "{\"totalCall\":0,\"totalCostTime\":0,\"correctNumber\":0,\"humanInterruptionNumber\":0,\"correctRate\":\"0.00\",\"averageCost\":\"0.00\"}";
}
tmpNode.anlyResult = JSON.parse(analyResultStr);
tmpTypicalCallChain.push(tmpNode);
if (tmpTypicalCallChainNodeIds[key] == undefined || tmpTypicalCallChainNodeIds[key] == "") {
this.currentTypicalTreeNodes.callChainTreeNodeList.push(tmpNode);