Skip to content

Commit 51853d3

Browse files
Merge pull request #9 from MakingSpiderSense/bugfix/vr-logger/93-fix-type-error
Improve message handling in VR logger by explicitly mapping null and undefined values
2 parents a86c7f5 + 370a804 commit 51853d3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/components/vr-logger/vr-logger.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ AFRAME.registerComponent("vr-logger", {
2222
console.log = (...args) => {
2323
originalConsoleLog(...args);
2424
// Add the console message to the array
25-
this.addMessage(args.map((a) => a.toString()).join(" "));
25+
this.addMessage(args.map((a) => {
26+
if (a === null) return 'null';
27+
if (a === undefined) return 'undefined';
28+
return a.toString();
29+
}).join(" "));
2630
};
2731
},
2832
// Add a message to the console

0 commit comments

Comments
 (0)