That's why I have the IsNothing statements
That suggests you expect the values to be IsNothing before they're given a specific value. In C#, this wouldn't just be a warning - it would be an error.
I have two suggestions:
If you really want to follow this pattern, just set the values to
Nothing
to start with:Dim fs As FileStream = Nothing Dim br As BinaryReader = Nothing
- If at all possible, reorganize your code so you can just use
Using
statements instead, which will close the streams at the end of the block either way. We can't tell enough about the rest of the code to help you do that at the moment though.