From 0736f291747b1fc4d3ce3b7d9ccbaa129d15ed20 Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Thu, 13 Aug 2020 09:02:13 +0200 Subject: Skip PostCompiler for empty byte arrays --- src/core/lombok/core/PostCompiler.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/core') diff --git a/src/core/lombok/core/PostCompiler.java b/src/core/lombok/core/PostCompiler.java index e17f806e..72f4b3a2 100644 --- a/src/core/lombok/core/PostCompiler.java +++ b/src/core/lombok/core/PostCompiler.java @@ -72,10 +72,12 @@ public final class PostCompiler { // no need to call super byte[] original = toByteArray(); byte[] copy = null; - try { - copy = applyTransformations(original, fileName, diagnostics); - } catch (Exception e) { - diagnostics.addWarning(String.format("Error during the transformation of '%s'; no post-compilation has been applied", fileName)); + if (original.length > 0) { + try { + copy = applyTransformations(original, fileName, diagnostics); + } catch (Exception e) { + diagnostics.addWarning(String.format("Error during the transformation of '%s'; no post-compilation has been applied", fileName)); + } } if (copy == null) { -- cgit