I have a simple tab view. There are 3 toggle buttons and 3 gameobject containers. When I tab back and forth that UIToggle.current is sometimes null on line 56. The issue is sporadic. If I click a tab and see an error log one time and the next time it will work !
Edit I fixed the solution. I referenced the local Toggle in awake and used that to set the value OnToggle. Does anyone else find it weird that you use a static variable to find a attached components value ?