Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 67a1dca

Browse files
hackweek
1 parent fed847b commit 67a1dca

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/optimizely-sdk/lib/utils/sprintf.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
const sprintf2 = require('sprintf-js').sprintf;
22

33
const sprintf = (message, moduleName, data) => {
4-
if (typeof data === 'string') return;
54
const dataValues = Object.keys(data).map(k => data[k]);
6-
return {
7-
...data,
8-
message: sprintf2.apply(sprintf2, [message, moduleName, ...dataValues]),
5+
try {
6+
return {
7+
...data,
8+
message: sprintf2.apply(sprintf2, [message, moduleName, ...dataValues]),
9+
}
10+
} catch (error) {
911
}
1012
};
1113

0 commit comments

Comments
 (0)