Fix a crash when adding call events to telemetry
Since typeof null is 'object', the flattenVoipEventRecursive function was mistakenly casting nulls to Record<string, unknown> in its typeof v === "object" case, causing Object.entries to explode.
This commit is contained in:
parent
a2b3e098b6
commit
0637804d61
1 changed files with 1 additions and 1 deletions
|
@ -74,7 +74,7 @@ function flattenVoipEventRecursive(
|
||||||
);
|
);
|
||||||
|
|
||||||
for (const [k, v] of Object.entries(obj)) {
|
for (const [k, v] of Object.entries(obj)) {
|
||||||
if (["string", "number", "boolean"].includes(typeof v)) {
|
if (["string", "number", "boolean"].includes(typeof v) || v === null) {
|
||||||
flatObject[prefix + k] = v;
|
flatObject[prefix + k] = v;
|
||||||
} else if (typeof v === "object") {
|
} else if (typeof v === "object") {
|
||||||
flattenVoipEventRecursive(
|
flattenVoipEventRecursive(
|
||||||
|
|
Loading…
Reference in a new issue