UI stops working with null reference exception in Graphic.depth

We occasionally get this exception with the 2017.4.26, at which point the entire UI stops responding:

Code (CSharp):
NullReferenceException
UnityEngine.UI.Graphic.get_depth () (at <69772e87ab5f45bb9d297c85a74a5ffd>:0)
UnityEngine.UI.GraphicRaycaster.Raycast (UnityEngine.Canvas canvas, UnityEngine.Camera eventCamera, UnityEngine.Vector2 pointerPosition, System.Collections.Generic.IList1[T] foundGraphics, System.Collections.Generic.List1[T] results) (at <69772e87ab5f45bb9d297c85a74a5ffd>:0)
UnityEngine.UI.GraphicRaycaster.Raycast (UnityEngine.EventSystems.PointerEventData eventData, System.Collections.Generic.List1[T] resultAppendList) (at <69772e87ab5f45bb9d297c85a74a5ffd>:0) UnityEngine.EventSystems.EventSystem.RaycastAll (UnityEngine.EventSystems.PointerEventData eventData, System.Collections.Generic.List1[T] raycastResults) (at <69772e87ab5f45bb9d297c85a74a5ffd>:0)
UnityEngine.EventSystems.PointerInputModule.GetMousePointerEventData (System.Int32 id) (at <69772e87ab5f45bb9d297c85a74a5ffd>:0)
UnityEngine.EventSystems.StandaloneInputModule.ProcessMouseEvent (System.Int32 id) (at <69772e87ab5f45bb9d297c85a74a5ffd>:0)
UnityEngine.EventSystems.StandaloneInputModule.ProcessMouseEvent () (at <69772e87ab5f45bb9d297c85a74a5ffd>:0)
UnityEngine.EventSystems.StandaloneInputModule.Process () (at <69772e87ab5f45bb9d297c85a74a5ffd>:0)
UnityEngine.EventSystems.EventSystem.Update () (at <69772e87ab5f45bb9d297c85a74a5ffd>:0)

Unfortunately we can’t properly reproduce it so far, but maybe someone has seen something similar happen and has an idea what might be going on?

Hello! This is a standard answer.

Before coming Unity answers, you must always google what your error means. And learn that in every error message, it says the line of code where is happening.

Null Reference errors occurs when there is some variable with value null when code tries to read it. You need to learn to find your problem by your own. First, check your error code, it says the line where the problem is. Second, You need to debug the code while running, and check the states of the variables of the line at the moment the error occurs,

I’m sure you will detect what variable value is NULL. Then investigate why.

Look for some tutorials on how to debug code while running on your scripting software if don’t know what I’m talking about.

Bye & good Luck!