Cannot read property ‘roles’ of null discord bot


I have a script where if a user is muted it will unmute it but I can’t find a the member has the muted role

Not Working code

      if(message.guild.member(message.mentions.users.id).roles.has(role => role.name === "Muted")){
    message.guild.member(message.mentions.users.id).roles.remove(role => role.name === "Muted")
  }else if (!message.guild.member(message.mentions.users.id).roles.has(role => role.name === "Muted")){
    message.guild.member(message.mentions.users.id).roles.add(role => role.name === "Muted")
  }