I don’t know how to fix “Cannot read properties of undefined”

let target; 
(!args[0]) ? (target = message.member) : (target = message.mentions.members.first() || message.guild.members.cache.get(args[0]))

if (!target) {
const uzy = await message.guild.members.fetch({ query: `${args[0]}`, limit: 1 })
target = uzy
 }

console.log(target.user.tag)

Cannot read properties of undefined (reading ‘tag’)