You are trying to use something that is null
(or Nothing
in VB.NET). This means you either set it to null
, or you never set it to anything at all.
Like anything else, null
gets passed around. If it is null
in method "A", it could be that method "B" passed a null
to method "A".
The rest of this article goes into more detail and shows mistakes that many programmers often make which can lead to a NullReferenceException
.