diff --git a/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/event/preconsensus/PreconsensusEventFileManager.java b/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/event/preconsensus/PreconsensusEventFileManager.java index ac36ab110c25..e9ce0ce0b48a 100644 --- a/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/event/preconsensus/PreconsensusEventFileManager.java +++ b/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/event/preconsensus/PreconsensusEventFileManager.java @@ -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); }