Convert to string before replace (#186)

This fixes this error  text.replace is not a function
When somebody has this nickname 1234567890 it thorws error in the server viewer.
This commit is contained in:
Ondřej Niesner 2021-03-24 18:06:05 +01:00 committed by GitHub
parent 70d2c7f870
commit c0b32f5992
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -124,7 +124,7 @@ function escapeHtml(text) {
"'": '''
};
return text.replace(/[&<>"']/g, function(m) { return map[m]; });
return text.toString().replace(/[&<>"']/g, function(m) { return map[m]; });
}
function updateTooltip(el, text) {