forked from Qortal/qortal
Ensure a patch exists after creating it.
This commit is contained in:
parent
dd33d24346
commit
179318f1d8
@ -122,6 +122,14 @@ public class ArbitraryDataWriter {
|
||||
ArbitraryDataCreatePatch patch = new ArbitraryDataCreatePatch(builtPath, this.filePath);
|
||||
patch.create();
|
||||
this.filePath = patch.getFinalPath();
|
||||
|
||||
// Validate the patch
|
||||
if (this.filePath == null) {
|
||||
throw new IllegalStateException("Null path after creating patch");
|
||||
}
|
||||
if (FilesystemUtils.isDirectoryEmpty(this.filePath)) {
|
||||
throw new IllegalStateException("Patch has no content. Either no files have changed, or something went wrong");
|
||||
}
|
||||
}
|
||||
|
||||
private void compress() {
|
||||
|
Loading…
Reference in New Issue
Block a user