NRE on Carbon Framework

Never got this NRE when using Oxide, but does appear when running my server on the Carbon framework. Should be an easy fix

==========================================================================================

Failed to call internal hook 'OnEntityBuilt' on plugin 'CupboardProtection v1.9.3' [641201665] (Object reference not set to an instance of an object) at void Oxide.Plugins.CupboardProtection.OnEntityBuilt(Planner plan, GameObject go) in /home/rustadmin/New_Horizons/carbon/plugins/CupboardProtection.cs:line 72 at object Oxide.Plugins.CupboardProtection.InternalCallHook(uint hook, object[] args) in CupboardProtection.cs/Internal:line 65

as i dont have carbon . and looking at the NRE . i dont see what can be the issue .. line 72 refer to getting BuildingPrivlage . and 65 points to Saving data file

I found it strange as well, because after switching to Carbon, several plugins had this issue. Either way here is the fix I used for CupboardProtection.

private void OnEntityBuilt(Planner plan, GameObject go)
          {
              if (go == null)
              {
                  return;
              }


              var Priv = go.GetComponent<BaseEntity>() as BuildingPrivlidge;
              if (Priv == null)
              {
                  return;
              }


              Vector3 oldPosition = Priv.transform.position;
              Vector3 tempPosition = new Vector3(Priv.transform.position.x, Priv.transform.position.y + 1F, Priv.transform.position.z);
              Priv.transform.position = tempPosition;
              var Foundation = GetFoundation(Priv);
              Priv.transform.position = oldPosition;


              if (Foundation == null)
              {
                  return;
              }


              IDData.IDs.Add(Priv.net.ID.Value, Foundation.net.ID.Value);
              SaveData();
          }

thanks bud . ill update it