Skip to content
Snippets Groups Projects
Commit aeef9e74 authored by Mohammad Alayoub's avatar Mohammad Alayoub
Browse files

fix error while adding a new word to blacklist when blacklist is undefined

parent f157cd09
No related merge requests found
......@@ -112,7 +112,7 @@ export class TopicCloudAdminService {
addWordToBlacklist(word: string) {
if (word !== undefined) {
this.getRoom().subscribe(room => {
const newlist = JSON.parse(room.blacklist);
const newlist = room.blacklist ? JSON.parse(room.blacklist) : [];
if (!newlist.includes(word)){
newlist.push(word.toLowerCase());
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment