Skip to content

Commit 0ebe65b

Browse files
committed
Simplify check in FileDatasetPartManagementService#storeData method
1 parent 2b659ca commit 0ebe65b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dataset/src/main/kotlin/com/cosmotech/dataset/part/services/FileDatasetPartManagementService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class FileDatasetPartManagementService(
3535
constructFilePath(organizationId, workspaceId, datasetId, datasetPartId, fileName)
3636
val fileAlreadyExists = s3Template.objectExists(csmPlatformProperties.s3.bucketName, filePath)
3737

38-
check(!(!overwrite && fileAlreadyExists)) { "File $filePath already exists" }
38+
check(overwrite || !fileAlreadyExists) { "File $filePath already exists" }
3939

4040
if (fileAlreadyExists) {
4141
logger.debug("Deleting existing file $filePath before overwriting it")

0 commit comments

Comments
 (0)