Skip to content

Commit 18337dc

Browse files
glenn.volckaertiText-CI
authored andcommitted
Adds proper handling of empty properties in CssFontFaceRule
DEVSIX-6339 Autoported commit. Original commit hash: [aaf9dee82]
1 parent 6db1bbf commit 18337dc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

itext/itext.styledxmlparser/itext/styledxmlparser/css/CssFontFaceRule.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ public CssFontFaceRule()
6060
/// <summary>Gets the properties.</summary>
6161
/// <returns>the properties</returns>
6262
public virtual IList<CssDeclaration> GetProperties() {
63+
if (properties == null) {
64+
return new List<CssDeclaration>();
65+
}
6366
return new List<CssDeclaration>(properties);
6467
}
6568

@@ -76,7 +79,7 @@ public override void AddBodyCssDeclarations(IList<CssDeclaration> cssDeclaration
7679
public override String ToString() {
7780
StringBuilder sb = new StringBuilder();
7881
sb.Append("@").Append(GetRuleName()).Append(" {").Append("\n");
79-
foreach (CssDeclaration declaration in properties) {
82+
foreach (CssDeclaration declaration in GetProperties()) {
8083
sb.Append(" ");
8184
sb.Append(declaration);
8285
sb.Append(";\n");

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
32b7cef68810f31fbac4035995430d0d6025ce76
1+
aaf9dee82b3f93db0f1e8367a6aa18f62cbe77d7

0 commit comments

Comments
 (0)