Fixed NPE in fetching autoconfig report

The report may not yet be available in the SpringBootApp and results in
NPE.
This commit is contained in:
nsingh
2017-10-22 21:30:56 -07:00
parent 13dfec091f
commit d3bd5d7011

View File

@@ -116,8 +116,10 @@ public class ConditionalsLiveHoverProvider implements HoverProvider {
try {
for (SpringBootApp app : runningApps) {
String autoConfigRecord = app.getAutoConfigReport();
JSONObject autoConfigJson = new JSONObject(autoConfigRecord);
return Optional.of(getConditionFromPositiveMatches(annotation, autoConfigJson));
if (autoConfigRecord != null) {
JSONObject autoConfigJson = new JSONObject(autoConfigRecord);
return Optional.of(getConditionFromPositiveMatches(annotation, autoConfigJson));
}
}
} catch (Exception e) {
Log.log(e);