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:
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user