diff --git a/src/main/java/tech/ailef/dbadmin/external/dbmapping/DbAdminRepository.java b/src/main/java/tech/ailef/dbadmin/external/dbmapping/DbAdminRepository.java index 9296525..bac7a7e 100644 --- a/src/main/java/tech/ailef/dbadmin/external/dbmapping/DbAdminRepository.java +++ b/src/main/java/tech/ailef/dbadmin/external/dbmapping/DbAdminRepository.java @@ -193,7 +193,10 @@ public class DbAdminRepository { files.keySet().forEach(f -> { try { - allValues.put(f, files.get(f).getBytes()); + // The file parameter gets sent even if empty, so it's needed + // to check if the file has actual content, to avoid storing an empty file + if (files.get(f).getSize() > 0) + allValues.put(f, files.get(f).getBytes()); } catch (IOException e) { throw new DbAdminException(e); }