From 274a880768c908f9eab69ca7882ffc2563abec59 Mon Sep 17 00:00:00 2001 From: kopareigns <kopareigns@gmail.com> Date: Tue, 29 May 2018 10:18:23 -0400 Subject: [PATCH] fix --- src/uncategorized/rename.tw | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/uncategorized/rename.tw b/src/uncategorized/rename.tw index a6f1e43e5bf..886bb09b3e5 100644 --- a/src/uncategorized/rename.tw +++ b/src/uncategorized/rename.tw @@ -35,9 +35,8 @@ <</if>> <<set _insultingName = 0>> -<<if $oldName != $activeSlave.slaveName>> - <<set _toSearch = $activeSlave.slaveName>> - <<set _toSearch = _toSearch.toLowerCase();>> +<<if $oldName != $activeSlave.slaveName && typeof $activeSlave.slaveName == "string">> + <<set _toSearch = $activeSlave.slaveName.toLowerCase()>> <<for $i = 0; $i < setup.badWords.length; $i++>> <<if _toSearch.indexOf(setup.badWords[$i]) != -1>> <<set _insultingName = 1>> @@ -46,9 +45,8 @@ <</for>> <</if>> <<if !_insultingName>> -<<if $oldSurname != $activeSlave.slaveSurname>> - <<set _toSearch = $activeSlave.slaveSurname>> - <<set _toSearch = _toSearch.toLowerCase();>> +<<if $oldSurname != $activeSlave.slaveSurname && typeof $activeSlave.slaveSurname == "string">> + <<set _toSearch = $activeSlave.slaveSurname.toLowerCase()>> <<for $i = 0; $i < setup.badWords.length; $i++>> <<if _toSearch.indexOf(setup.badWords[$i]) != -1>> <<set _insultingName = 1>> -- GitLab