Переглянути джерело

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

tags/v0.12.0.22^0
Shaun 9 місяці тому
джерело
коміт
37cf7493f8
1 змінених файлів з 4 додано та 1 видалено
  1. +4
    -1
      src/server/components/social/teleport.js

+ 4
- 1
src/server/components/social/teleport.js Переглянути файл

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


Завантаження…
Відмінити
Зберегти