Skip to content

Commit

Permalink
Elegantly handle when an empty PCES is cleared. (#8627)
Browse files Browse the repository at this point in the history
Signed-off-by: Cody Littley <[email protected]>
  • Loading branch information
cody-littley authored Sep 15, 2023
1 parent cddaab2 commit 52a11c1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,10 @@ public static void clear(
@NonNull final RecycleBin recycleBin,
@NonNull final NodeId selfId) {
try {
recycleBin.recycle(getDatabaseDirectory(platformContext, selfId));
final Path path = getDatabaseDirectory(platformContext, selfId);
if (Files.exists(path)) {
recycleBin.recycle(path);
}
} catch (final IOException e) {
throw new UncheckedIOException("unable to recycle preconsensus event files", e);
}
Expand Down

0 comments on commit 52a11c1

Please sign in to comment.