Browse Source

bug: Fixed a crash caused by calling teleportr with incorrect arguments

tags/v0.12.0.22^0
Shaun 9 months ago
parent
commit
37cf7493f8
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      src/server/components/social/teleport.js

+ 4
- 1
src/server/components/social/teleport.js View File

@@ -2,7 +2,10 @@ module.exports = async (cpnSocial, targetName) => {
const { obj } = cpnSocial;
const { instance: { objects, physics }, syncer } = obj;

const target = objects.find(o => o.name && o.name.toLowerCase().includes(targetName.toLowerCase()));
if (typeof(targetName) !== 'string')
return;

const target = objects.find(o => o.name?.toLowerCase().includes(targetName.toLowerCase()));

if (!target)
return;


Loading…
Cancel
Save