This is an automated email from the ASF dual-hosted git repository.
vy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/master by this push:
new c45b358 Fix NPE in DefaultRolloverStrategy. (#755)
c45b358 is described below
commit c45b358ae17771f936307565a773616fb2e432f0
Author: Volkan Yazici <[email protected]>
AuthorDate: Wed Feb 16 12:42:24 2022 +0100
Fix NPE in DefaultRolloverStrategy. (#755)
---
.../logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
index d606756..87bc6bb 100644
---
a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
+++
b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
@@ -139,7 +139,8 @@ public class DefaultRolloverStrategy extends
AbstractRolloverStrategy {
}
}
}
- final int compressionLevel =
Integers.parseInt(compressionLevelStr.trim(), Deflater.DEFAULT_COMPRESSION);
+ final String trimmedCompressionLevelStr = compressionLevelStr !=
null ? compressionLevelStr.trim() : compressionLevelStr;
+ final int compressionLevel =
Integers.parseInt(trimmedCompressionLevelStr, Deflater.DEFAULT_COMPRESSION);
// The config object can be null when this object is built
programmatically.
final StrSubstitutor nonNullStrSubstitutor = config != null ?
config.getStrSubstitutor() : new StrSubstitutor();
return new DefaultRolloverStrategy(minIndex, maxIndex, useMax,
compressionLevel, nonNullStrSubstitutor,