Skip to content

Commit 196fdd0

Browse files
committed
Fix issue in CellRenderer
DEVSIX-1195 Autoported commit. Original commit hash: [da5798b5c]
1 parent a9b3e90 commit 196fdd0

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

itext/itext.layout/itext/layout/renderer/AbstractRenderer.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,11 +1396,13 @@ protected internal virtual MinMaxWidth GetMinMaxWidth(float availableWidth) {
13961396
protected internal virtual bool SetMinMaxWidthBasedOnFixedWidth(MinMaxWidth minMaxWidth) {
13971397
// retrieve returns max width, if there is no width.
13981398
if (HasAbsoluteUnitValue(Property.WIDTH)) {
1399+
//Renderer may override retrieveWidth, double check is required.
13991400
float? width = RetrieveWidth(0);
1400-
System.Diagnostics.Debug.Assert(width != null);
1401-
minMaxWidth.SetChildrenMaxWidth((float)width);
1402-
minMaxWidth.SetChildrenMinWidth((float)width);
1403-
return true;
1401+
if (width != null) {
1402+
minMaxWidth.SetChildrenMaxWidth((float)width);
1403+
minMaxWidth.SetChildrenMinWidth((float)width);
1404+
return true;
1405+
}
14041406
}
14051407
return false;
14061408
}

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6650368ed56846360542340f22201da270a441f2
1+
da5798b5cf162be5c1dd163f02f530299b6e46e3

0 commit comments

Comments
 (0)