Error when trying to Enable gameobject

Okay, so I have been trying to switch between menu screens by enabling/disabling them, and it works for the most part, but when I try to switch back to the previous screen/menu (there is only two) it gives me an error, is this because it cant find the disabled object?

NullReferenceException: Object reference not set to an instance of an object
Back.Clicked () (at Assets/Scripts/Back.cs:21)
UnityEngine.Events.InvokableCall.Invoke (System.Object args) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:153)
UnityEngine.Events.InvokableCallList.Invoke (System.Object parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:636)
UnityEngine.Events.UnityEventBase.Invoke (System.Object parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:771)
UnityEngine.Events.UnityEvent.Invoke () (at C:/buildslave/unity/build/Runtime/Export/UnityEvent_0.cs:52)
UnityEngine.UI.Button.Press () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:35)
UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:44)
UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:52)
UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:269)

public void Clicked()
	mainMenu.gameObject.SetActive (true);
	shop.gameObject.SetActive (false);

GameObject.Find will not return inactive GameObjects- make the mainMenu and shop references public and then drag and drop the references in the inspector instead.

Unfortunately, there’s no way to make GameObject.Find find inactive objects, so some common choices are Resources.FindObjectsOfTypeAll (which is horrendous for a dozen reasons), drag and dropping references in the inspector, or starting the menus as enabled and then immediately disabling them in Start (so your back button has a chance to GameObject.Find them in Awake). The drag-and-dropping method is by far the best approach out of those.

If you want to put a little more effort into it though, you can put both menus under a common parent with a manager on it. You can then disable the menus, but the parent is alive and kicking, so you can search and find that just fine, get the manager component from it, and let it do the disabling and enabling for you as needed. The manager can be the same manager used to control visibility of your back button itself. You should still just drag-and-drop the references rather than using GameObject.Find though- the performance hit for iterating over every active object in a scene and doing string-comparisons for each is no joke.