From 1a0c20f04f4c14c1447f4e2f3806b237a5623456 Mon Sep 17 00:00:00 2001 From: To-om Date: Fri, 26 Nov 2021 09:17:50 +0100 Subject: [PATCH] #2263 Fix dataType existence test --- thehive/app/org/thp/thehive/services/ObservableTypeSrv.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thehive/app/org/thp/thehive/services/ObservableTypeSrv.scala b/thehive/app/org/thp/thehive/services/ObservableTypeSrv.scala index 132585dfe8..996ec7dbe9 100644 --- a/thehive/app/org/thp/thehive/services/ObservableTypeSrv.scala +++ b/thehive/app/org/thp/thehive/services/ObservableTypeSrv.scala @@ -35,7 +35,7 @@ class ObservableTypeSrv @Inject() (@Named("integrity-check-actor") integrityChec createEntity(observableType) def remove(idOrName: EntityIdOrName)(implicit graph: Graph): Try[Unit] = - if (isUsed(idOrName)) Success(get(idOrName).remove()) + if (!isUsed(idOrName)) Success(get(idOrName).remove()) else Failure(BadRequestError(s"Observable type $idOrName is used")) def isUsed(idOrName: EntityIdOrName)(implicit graph: Graph): Boolean = get(idOrName).inE[ObservableObservableType].exists