Skip to content

Commit bffcdaf

Browse files
Add error handling
1 parent d66c7fc commit bffcdaf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/sdkClient/client.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ function treatmentsNotReady(featureFlagNames: string[]) {
2424
}
2525

2626
function stringify(options?: SplitIO.EvaluationOptions) {
27-
return options && options.properties ? JSON.stringify(options.properties) : undefined;
27+
if (options && options.properties) {
28+
try {
29+
return JSON.stringify(options.properties);
30+
} catch { /* JSON.stringify should never throw with validated options, but handling just in case */ }
31+
}
2832
}
2933

3034
/**

0 commit comments

Comments
 (0)