@@ -341,15 +341,15 @@ def create(self, **kwargs):
341341 object_result ["name" ] = name
342342 # description
343343 if (
344- description is not None
344+ self . opencti . not_empty ( description )
345345 and object_result ["description" ] != description
346346 ):
347347 self .opencti .stix_domain_entity .update_field (
348348 id = object_result ["id" ], key = "description" , value = description
349349 )
350350 object_result ["description" ] = description
351351 # alias
352- if alias is not None and object_result ["alias" ] != alias :
352+ if self . opencti . not_empty ( alias ) and object_result ["alias" ] != alias :
353353 if "alias" in object_result :
354354 new_aliases = object_result ["alias" ] + list (
355355 set (alias ) - set (object_result ["alias" ])
@@ -373,14 +373,14 @@ def create(self, **kwargs):
373373 )
374374 object_result ["last_seen" ] = last_seen
375375 # goal
376- if goal is not None and object_result ["goal" ] != goal :
376+ if self . opencti . not_empty ( goal ) and object_result ["goal" ] != goal :
377377 self .opencti .stix_domain_entity .update_field (
378378 id = object_result ["id" ], key = "goal" , value = goal
379379 )
380380 object_result ["goal" ] = goal
381381 # sophistication
382382 if (
383- sophistication is not None
383+ self . opencti . not_empty ( sophistication )
384384 and object_result ["sophistication" ] != sophistication
385385 ):
386386 self .opencti .stix_domain_entity .update_field (
@@ -391,7 +391,7 @@ def create(self, **kwargs):
391391 object_result ["sophistication" ] = sophistication
392392 # resource_level
393393 if (
394- resource_level is not None
394+ self . opencti . not_empty ( resource_level )
395395 and object_result ["resource_level" ] != resource_level
396396 ):
397397 self .opencti .stix_domain_entity .update_field (
@@ -402,7 +402,7 @@ def create(self, **kwargs):
402402 object_result ["resource_level" ] = resource_level
403403 # primary_motivation
404404 if (
405- primary_motivation is not None
405+ self . opencti . not_empty ( primary_motivation )
406406 and object_result ["primary_motivation" ] != primary_motivation
407407 ):
408408 self .opencti .stix_domain_entity .update_field (
@@ -413,7 +413,7 @@ def create(self, **kwargs):
413413 object_result ["primary_motivation" ] = primary_motivation
414414 # secondary_motivation
415415 if (
416- secondary_motivation is not None
416+ self . opencti . not_empty ( secondary_motivation )
417417 and object_result ["secondary_motivation" ] != secondary_motivation
418418 ):
419419 self .opencti .stix_domain_entity .update_field (
0 commit comments