Skip to content

Commit

Permalink
Fix issue with NullPointerException due to Integer-cast (eclipse-birt…
Browse files Browse the repository at this point in the history
  • Loading branch information
speckyspooky authored Mar 12, 2024
1 parent 3a5247b commit 6d889f6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public void layout(IFigure container) {
for (int i = 0; i < children.size(); i++) {
IFigure child = (IFigure) children.get(i);
Dimension childSize = child.getPreferredSize();
int position = ((Integer) getConstraint(child)).intValue();
Integer constraint = (Integer) getConstraint(child);
int position = constraint == null ? 0 : (constraint).intValue();
if (((EditorRulerFigure) container).isHorizontal()) {
childSize.height = rulerSize.height - 1;
Rectangle.SINGLETON.setLocation(position - (childSize.width / 2), rulerSize.y);
Expand Down

0 comments on commit 6d889f6

Please sign in to comment.