Unhandled Rejection (TypeError): Cannot read properties of null (reading 'attributes')

 const checkIfLinked = async () => {
    const currentUser = Moralis.User.current();
    const accounts = await currentUser.attributes.account;
    let accountLinked: boolean;
    if (accounts !== undefined) {
      return (accountLinked = accounts.includes(
    } else {
      accountLinked = false;
      return accountLinked;

you could check if currentUser is defined or not

yes current user is defined… i used email to logged in

I mean to check the variable when is undefined, from that error it looks like it is undefined