Skip to content

Commit f7f67c3

Browse files
committed
GH-249 getAllEngineInstances() can return collection with null elements
(cherry picked from commit 6377e2b)
1 parent 7dd6012 commit f7f67c3

File tree

1 file changed

+3
-0
lines changed
  • visualvm/sampler.truffle/libsrc/org/graalvm/visualvm/sampler/truffle/stagent

1 file changed

+3
-0
lines changed

visualvm/sampler.truffle/libsrc/org/graalvm/visualvm/sampler/truffle/stagent/Truffle.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ private Collection<CPUSampler> getAllStackTracesInstances() {
213213
Collection<Engine> all = getAllEngineInstances();
214214

215215
for (Engine engine : all) {
216+
if (engine == null) continue;
216217
CPUSampler sampler = CPUSampler.find(engine);
217218

218219
if (sampler != null) {
@@ -251,6 +252,7 @@ private Collection<HeapMonitor> getAllHeapHistogramInstances() {
251252
Collection<Engine> all = getAllEngineInstances();
252253

253254
for (Engine engine : all) {
255+
if (engine == null) continue;
254256
HeapMonitor heapHisto = HeapMonitor.find(engine);
255257

256258
if (heapHisto != null) {
@@ -333,6 +335,7 @@ private void setMode(Mode m) {
333335
Collection<Engine> all = getAllEngineInstances();
334336

335337
for (Engine engine : all) {
338+
if (engine == null) continue;
336339
CPUSampler sampler = CPUSampler.find(engine);
337340

338341
if (sampler != null) {

0 commit comments

Comments
 (0)