Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add null checks
  • Loading branch information
V Udayani committed Nov 8, 2022
commit 64e8100b891f7178ee286f0b62ce2eb9b954adac
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ public SpringProcessMemoryMetricsLiveData refreshMemoryMetrics(SpringProcessLive
this.processName = liveData.getProcessName();
}

if (liveData != null && liveData.getHeapMemoryMetrics() != null && liveData.getHeapMemoryMetrics().length > 0 && liveData.getNonHeapMemoryMetrics().length > 0) {
if (liveData != null && liveData.getHeapMemoryMetrics() != null && liveData.getHeapMemoryMetrics().length > 0 &&
liveData.getNonHeapMemoryMetrics() != null && liveData.getNonHeapMemoryMetrics().length > 0) {
return liveData;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ public SpringProcessMemoryMetricsLiveData refreshMemoryMetrics(SpringProcessLive
log.info("retrieve live data from: " + jmxURL);
SpringProcessMemoryMetricsLiveData liveData = springJMXConnector.retrieveLiveMemoryMetricsData(getProcessType(), jmxConnection, processID, processName, currentData, metricName, tags);

if (liveData != null && liveData.getHeapMemoryMetrics() != null && liveData.getHeapMemoryMetrics().length > 0 && liveData.getNonHeapMemoryMetrics().length > 0) {
if (liveData != null && liveData.getHeapMemoryMetrics() != null && liveData.getHeapMemoryMetrics().length > 0 &&
liveData.getNonHeapMemoryMetrics() != null && liveData.getNonHeapMemoryMetrics().length > 0) {
return liveData;
}
}
Expand Down