Skip to content

Commit cc6ae4c

Browse files
committed
Fix identity traits data type
1 parent e2817c5 commit cc6ae4c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Engine/Engine.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ private static function _getContextValue($context, $property)
372372
}
373373

374374
if ($context->identity !== null) {
375-
return $context->identity->traits->{$property} ?? null;
375+
return $context->identity->traits[$property] ?? null;
376376
}
377377

378378
return null;

src/Engine/Utils/Types/Context/EvaluationContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static function fromJsonObject($jsonContext)
3232
$context->identity = new IdentityContext();
3333
$context->identity->key = $jsonContext->identity->key;
3434
$context->identity->identifier = $jsonContext->identity->identifier;
35-
$context->identity->traits = $jsonContext->identity->traits;
35+
$context->identity->traits = (array) ($jsonContext->identity->traits ?? []);
3636

3737
$context->segments = [];
3838
foreach ($jsonContext->segments as $jsonSegment) {

0 commit comments

Comments
 (0)