Parcourir la source

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

tags/v0.12.0.22^0
Shaun il y a 9 mois
Parent
révision
37cf7493f8
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. +4
    -1
      src/server/components/social/teleport.js

+ 4
- 1
src/server/components/social/teleport.js Voir le fichier

@@ -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;


Chargement…
Annuler
Enregistrer