mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for WebStatFilter NullPointerException
This commit is contained in:
@@ -191,7 +191,7 @@ public class WebStatFilter implements Filter {
|
||||
|
||||
if (isProfileEnable()) {
|
||||
Profiler.release(nanos);
|
||||
|
||||
|
||||
Map<ProfileEntryKey, ProfileEntryReqStat> requestStatsMap = Profiler.getStatsMap();
|
||||
if (uriStat != null) {
|
||||
uriStat.getProfiletat().record(requestStatsMap);
|
||||
@@ -382,8 +382,9 @@ public class WebStatFilter implements Filter {
|
||||
StatFilterContext.getInstance().addContextListener(statFilterContextListener);
|
||||
|
||||
this.contextPath = DruidWebUtils.getContextPath(config.getServletContext());
|
||||
webAppStat = new WebAppStat(contextPath, this.sessionStatMaxCount);
|
||||
|
||||
if (webAppStat == null) {
|
||||
webAppStat = new WebAppStat(contextPath, this.sessionStatMaxCount);
|
||||
}
|
||||
WebAppStatManager.getInstance().addWebAppStatSet(webAppStat);
|
||||
}
|
||||
|
||||
@@ -412,6 +413,10 @@ public class WebStatFilter implements Filter {
|
||||
this.profileEnable = profileEnable;
|
||||
}
|
||||
|
||||
public void setWebAppStat(WebAppStat webAppStat) {
|
||||
this.webAppStat = webAppStat;
|
||||
}
|
||||
|
||||
public WebAppStat getWebAppStat() {
|
||||
return webAppStat;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user