Skip to content

Commit 0b37ef2

Browse files
authored
gracefully handle if allocation has no holdouts field (#32)
1 parent 783097e commit 0b37ef2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eppo/js-client-sdk-common",
3-
"version": "1.8.0",
3+
"version": "1.8.1",
44
"description": "Eppo SDK for client-side JavaScript applications (base for both web and react native)",
55
"main": "dist/index.js",
66
"files": [

src/client/eppo-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ export default class EppoClient implements IEppoClient {
361361
let holdoutVariation = null;
362362

363363
const holdoutShard = getShard(`holdout-${subjectKey}`, subjectShards);
364-
const matchingHoldout = holdouts.find((holdout) => {
364+
const matchingHoldout = holdouts?.find((holdout) => {
365365
const { statusQuoShardRange, shippedShardRange } = holdout;
366366
if (isShardInRange(holdoutShard, statusQuoShardRange)) {
367367
assignedVariation = variations.find(

0 commit comments

Comments
 (0)