From 37487c4f5226b3990057122d2edc59c116c122c0 Mon Sep 17 00:00:00 2001 From: SoXX Date: Tue, 15 Oct 2024 10:45:55 +0200 Subject: [PATCH] fix: consistent id check - use consistent methode to check if the id is 0 --- pkg/database/pool_reference.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/database/pool_reference.go b/pkg/database/pool_reference.go index e675a07..fed3315 100644 --- a/pkg/database/pool_reference.go +++ b/pkg/database/pool_reference.go @@ -40,7 +40,7 @@ func CreatePoolReference(ctx context.Context, poolID models.PoolID, sourceID mod return models.PoolReference{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsWrongLength}) } - if sourceID == "" { + if len(sourceID) == 0 { return models.PoolReference{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.SourceIDIsEmpty}) } @@ -100,7 +100,7 @@ func DeletePoolReference(ctx context.Context, poolID models.PoolID, sourceID mod return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PostIDIsWrongLength}) } - if sourceID == "" { + if len(sourceID) == 0 { return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.SourceIDIsEmpty}) }