Avoid NPE if writer is not set in AbstractRenderer.flush

This commit is contained in:
Andreas Dangel
2022-02-17 18:52:53 +01:00
parent 1645f963a8
commit 488f8c716f

View File

@ -103,6 +103,11 @@ public abstract class AbstractRenderer extends AbstractPropertySource implements
@Override
public void flush() {
if (writer == null) {
// might happen, if no writer is set. E.g. in maven-pmd-plugin's PmdCollectingRenderer
return;
}
try {
this.writer.flush();
} catch (IOException e) {