My dagger attached to an enemy won't detect it's parent's Ai Script

ERROR: NullRefrenceException: Object Refrence not set as an instance of an object DaggersScript.Update() (at Assets/DaggersScript.cs:34)

So I checked line 34 and checked all of the names and set all of the types to public and it still won’t detect the Ai script attached to its parent, and no, I can’t manually assign it through the inspector because the enemy is a prefab

using UnityEngine;
using System.Collections;

public class DaggersScript : MonoBehaviour {

    private GameObject Player;
    private bool Attacking;
    private bool Charging;
    private int TimeToTillAttack;
    private bool ChargingAtPlayer;
    private Transform DaggerPosition;
    private GameObject Dagger;
     public GameObject Enemy;
    public BasicEnemyAi BasicAi;
   // private float Timer;
    private Animator animate;
    public AnimationClip ChargeUp;
    public AnimationClip Attack;
    void Start ()
    {
        animate = GetComponent<Animator>();
        Player = GameObject.FindGameObjectWithTag("Player");
        Enemy = transform.parent.gameObject;
        DaggerPosition = gameObject.transform.GetChild(0);
        Dagger = transform.parent.gameObject;
        BasicEnemyAi BasicAi = Enemy.GetComponent<BasicEnemyAi>();
       // Timer = Attack.length;
//        Attack.length = 0;
    }
	
	// Update is called once per frame
	void Update ()
    {
	if(BasicAi.Timer <= 0)
        {
            Charging = false;
            ChargingAtPlayer = true;
            return;
        }
    else
        {
            Charging = true;
            ChargingAtPlayer = false;
        }
    
    }
}

Your declaring BasicAi twice.

Change Line 26

BasicEnemyAi BasicAi = Enemy.GetComponent<BasicEnemyAi>();

To

BasicAi = Enemy.GetComponent<BasicEnemyAi>();

That’s all I can think of. Hopefully it helps.