Polish "Avoid NPE when binder is closed before started event"

See gh-22141
This commit is contained in:
Andy Wilkinson
2020-06-30 13:26:30 +01:00
parent b34c268547
commit 3922fb7164
2 changed files with 39 additions and 1 deletions

View File

@@ -86,7 +86,7 @@ public class TomcatMetricsBinder implements ApplicationListener<ApplicationStart
@Override
public void destroy() {
if (null != this.tomcatMetrics) {
if (this.tomcatMetrics != null) {
this.tomcatMetrics.close();
}
}