NullReferenceException on function call

Hello unity community, I know this question is asked alot and I really have tried to find the answer I’m looking for, but I just don’t know what to search for or where to look.
I just can’t get away from this exception:

NullReferenceException: Object
reference not set to an instance of an
object
LoginScript+c__Iterator2.MoveNext
() (at
Assets/Scripts/LoginScript.cs:91)

All needed variables are public.

All classes have the following applied:

public static ClassName Instance
	{
		get
		{
			return _instance;
		}
	}
	private static ClassName _instance;

This is the function that gives me the exception:

IEnumerator login(WWW w)
	{
		message += "Logging in..";
		yield return w;
		if (w.error == null)
		{
			if (w.text == "Success")
			{
				loggedin = true;
				message = "";
				status = "Online";
				AppManager.Instance.UpdateStatus(); <-- This is where I get the null reference exception
			}
			else
			{
				message += w.text;
			}
		}
		else
		{
			message += "ERROR: " + w.error + "

";
}
}

The UpdateStatus() function looks like this:

public void UpdateStatus()
	{
		WWWForm updateform = new WWWForm();
		updateform.AddField("action", "updatestatus");
		updateform.AddField("token", LoginScript.Instance.token);
		updateform.AddField("user", LoginScript.Instance.user);
		updateform.AddField("status", LoginScript.Instance.status);
		updateform.AddField("pos", "");
		WWW ww = new WWW(LoginScript.Instance.usermanagerpage, updateform);
		StartCoroutine(SendDataToDatabase(ww));
	}

Thanks in advance!

Try to make the singleton class like this:

public class AnyClass : MonoBehaviour
{
     private static AnyClass _instance;
     
     public static AnyClass GetInstance()
     {
         if(_instance == null)
         {
             GameObject obj = new GameObject();
             _instance = obj.AddComponent<AnyClass>();
         }
          
          return _instance;
     }
}

also it is pretty much the same if the singleton class doensnt have to be a MonoBehaviour:

public class AnyClass
{
   private static AnyClass _instance;

   public static AnyClass GetInstance()
   {
       if(_instance == null)
       {
           _instance = new AnyClass();
       }
       
       return _instance;
   }

}

In both cases you can use it anywhere like this:

AnyClass.GetInstance().DoWhatever();

And with this strategy you can be absolutetly sure that the instance is not null when you are using it.