Skip to content

Commit 7f66c8d

Browse files
authored
add null check while getting environments (#427)
1 parent 84f549c commit 7f66c8d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/org/digma/intellij/plugin/toolwindow/recentactivity/DigmaBottomToolWindowFactory.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,19 @@ private void processRecentActivityGoToTraceRequest(RecentActivityGoToTraceReques
204204

205205
private void processRecentActivityGetDataRequest(AnalyticsService analyticsService, JBCefBrowser jbCefBrowser) {
206206
List<String> allEnvironments = analyticsService.getEnvironments();
207-
List<String> sortedEnvironments = getSortedEnvironments(allEnvironments, localHostname);
207+
if(allEnvironments == null) {
208+
Log.log(LOGGER::warn, "error while getting environments from server");
209+
return;
210+
}
208211
RecentActivityResult recentActivityData = null;
209212
try {
210213
recentActivityData = analyticsService.getRecentActivity(allEnvironments);
211214
} catch (AnalyticsServiceException e) {
212215
Log.log(LOGGER::warn, "AnalyticsServiceException for getRecentActivity: {}", e.getMessage());
213216
}
217+
214218
if (recentActivityData != null) {
219+
List<String> sortedEnvironments = getSortedEnvironments(allEnvironments, localHostname);
215220
String requestMessage = JBCefBrowserUtil.resultToString(new JcefMessageRequest(
216221
REQUEST_MESSAGE_TYPE,
217222
RECENT_ACTIVITY_SET_DATA,

0 commit comments

Comments
 (0)