Skip PostCompiler for empty byte arrays

This commit is contained in:
Rawi01 authored and Roel Spilker committed 2020-08-27 22:57:07 +02:00
1 parent 2ac4faf14c
commit 0736f29174
1 file changed
+6 -4
+6 -4
View File
@@ -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) {