From 618ad1938b2ecaa9e96bc6fa7c522ce0b106f583 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Thu, 10 Jul 2025 22:24:33 -0500 Subject: [PATCH] full data DTO close data source if corrupted --- .../core/sql/dto/FullDataSourceV2DTO.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/sql/dto/FullDataSourceV2DTO.java b/core/src/main/java/com/seibel/distanthorizons/core/sql/dto/FullDataSourceV2DTO.java index 7b53f86c4..3d4476161 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/sql/dto/FullDataSourceV2DTO.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/sql/dto/FullDataSourceV2DTO.java @@ -142,7 +142,16 @@ public class FullDataSourceV2DTO public FullDataSourceV2 createDataSource(@NotNull ILevelWrapper levelWrapper) throws IOException, InterruptedException, DataCorruptedException { FullDataSourceV2 dataSource = FullDataSourceV2.createEmpty(this.pos); - this.internalPopulateDataSource(dataSource, levelWrapper, false); + try + { + this.internalPopulateDataSource(dataSource, levelWrapper, false); + } + catch (Exception e) + { + dataSource.close(); + throw e; + } + return dataSource; }