Skip to content

Commit 9ef83fb

Browse files
committed
Catch more generic exception due to differences between Java and C#
1 parent 03445e6 commit 9ef83fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

layout/src/main/java/com/itextpdf/layout/renderer/AbstractRenderer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ protected void applyAbsolutePosition(Rectangle parentRect) {
904904
if (bottom != null) {
905905
move(0, parentRect.getBottom() + (float) bottom - occupiedArea.getBBox().getBottom());
906906
}
907-
} catch (NullPointerException exc) {
907+
} catch (Exception exc) {
908908
Logger logger = LoggerFactory.getLogger(AbstractRenderer.class);
909909
logger.error(MessageFormatUtil.format(LogMessageConstant.OCCUPIED_AREA_HAS_NOT_BEEN_INITIALIZED, "Absolute positioning might be applied incorrectly."));
910910
}
@@ -1057,7 +1057,7 @@ protected void alignChildHorizontally(IRenderer childRenderer, Rectangle current
10571057
childRenderer.move(freeSpace / 2, 0);
10581058
break;
10591059
}
1060-
} catch (NullPointerException npe) {
1060+
} catch (Exception npe) {
10611061
Logger logger = LoggerFactory.getLogger(AbstractRenderer.class);
10621062
logger.error(MessageFormatUtil.format(LogMessageConstant.OCCUPIED_AREA_HAS_NOT_BEEN_INITIALIZED, "Some of the children might not end up aligned horizontally."));
10631063
}

0 commit comments

Comments
 (0)