Game object isn't added via one class to another one (Navigation bar class)

Fortunately it doesn’t even matter what you are doing. The answer is ALWAYS the same for NullReference.

How to fix a NullReferenceException error

https://forum.unity.com/threads/how-to-fix-a-nullreferenceexception-error.1230297/

Three steps to success:

  • Identify what is null ← don’t move past this until you have got it right!
  • Identify why it is null
  • Fix that

For a future problem that actually needs a forum post, remember that photographs of code are not a thing. If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: Using code tags properly