提交 fb5fd4c7 编写于 作者: Y youyong205

fix npe

上级 d8632dea
......@@ -97,7 +97,12 @@ public class Handler implements PageHandler<Context> {
if (isCurrent) {
seconds = (System.currentTimeMillis() - payload.getCurrentDate()) / 1000.0;
} else {
seconds = (report.getEndTime().getTime() - report.getStartTime().getTime()) / 1000.0;
Date endTime = report.getEndTime();
Date startTime = report.getStartTime();
if (startTime != null && endTime != null) {
seconds = (endTime.getTime() - startTime.getTime()) / 1000.0;
}
}
new TpsStatistics(seconds).visitEventReport(report);
}
......@@ -115,7 +120,12 @@ public class Handler implements PageHandler<Context> {
if (isCurrent) {
seconds = (System.currentTimeMillis() - payload.getCurrentDate()) / 1000.0;
} else {
seconds = (report.getEndTime().getTime() - report.getStartTime().getTime()) / 1000.0;
Date endTime = report.getEndTime();
Date startTime = report.getStartTime();
if (startTime != null && endTime != null) {
seconds = (endTime.getTime() - startTime.getTime()) / 1000.0;
}
}
new com.dianping.cat.report.page.transaction.TpsStatistics(seconds).visitTransactionReport(report);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册