firebase database unity problem

i really don’t know what i am doing wrong, i made another class names User and stored a string called username in it, and then on another script put this code, so i can save database in firebase, it says that the line (DBreference.Child…) is the line that is causing the error and it is object reference not set to an instance

public void SaveData()
    {
        User user = new User();
        user.Username = usernameRegisterField.text;
        string json = JsonUtility.ToJson(user);
        DBreference.Child("User").Child(user.Username).SetRawJsonValueAsync(json).ContinueWith(task =>
        {
            if (task.IsCompleted)
            {
                Debug.Log("successfully added data");
            }
            else
            {
                Debug.Log("not successfull");
            }
        });
    }

It’s a standard null ref error.
So, start debugging your values and see what is null. Is DBreference null?

Also, I suggest always using ContinueWithOnMainThread instead of just ContinueWith.

Thank you so much for the response! i will try to fix it