Skip to content

Commit 9dfca62

Browse files
committed
ComponentBuilders.java, line 191 (Null Dereference) - Fortify
1 parent bdb2bc9 commit 9dfca62

File tree

1 file changed

+5
-3
lines changed
  • visualvm/libs.profiler/profiler.heapwalker/src/org/graalvm/visualvm/lib/profiler/heapwalk/details/jdk/ui

1 file changed

+5
-3
lines changed

visualvm/libs.profiler/profiler.heapwalker/src/org/graalvm/visualvm/lib/profiler/heapwalk/details/jdk/ui/ComponentBuilders.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,11 @@ protected void setupInstance(T instance) {
188188

189189
// #250485 - large components may cause OOME when previewing
190190
Rectangle rect = bounds.createInstance();
191-
rect.width = Math.min(rect.width, MAX_WIDTH);
192-
rect.height = Math.min(rect.height, MAX_HEIGHT);
193-
instance.setBounds(rect);
191+
if (rect != null) {
192+
rect.width = Math.min(rect.width, MAX_WIDTH);
193+
rect.height = Math.min(rect.height, MAX_HEIGHT);
194+
instance.setBounds(rect);
195+
}
194196

195197
// if (foreground != null) instance.setForeground(foreground.createInstance());
196198
// if (background != null) instance.setBackground(background.createInstance());

0 commit comments

Comments
 (0)