Unity3D – MissingReferenceException: The object of type __ has been destroyed but you are still trying to access it

If you get this error:

"MissingReferenceException: The object of type __ has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object."

then the first thing you should do is to check if you have (additional) inspector window locked. Simply unlock it (you can see the small lock in top right corner of inspector window) and this error should go away.

unity3d inspector lock
I have no idea what is causing it (I am just starting out with Unity) but this solved it. Luckily I found the answer quite fast and did not need to debug and waste a lot of time checking the code when the code was completely fine.