You're correct in assuming that the value is later passed to a function taking an object as a parameter, and that what he was trying to achieve (and failed at) was calling the function with Nothing if the value if bar was 0.
You're not a .Net developer I take it. The result of assigning Nothing (equivalent to null in the C family of languages) to an Integer (primitve type like int) is that the value will end up as 0.
What he could have done was either:
If bar = 0 Then
DoSomething(Nothing)
Else
DoSomething(bar)
End If
Or he could have looked at the function and realized there was an overload prepared to take one of the Nullable objects (a generic wrapper around value types like ints and structs so you can pass null/Nothing to functions, there is even a convenient shorthand, "Integer?", for a nullable int. Something like (verbose, could be shortened to a oneliner):
Dim tmpBar As Integer?
If bar = 0 Then
tmpBar = Nothing
Else
tmpBar = bar
End If
DoSomething(tmpBar)
Or perhaps even have changed the type of bar, to simplify it further. Instead he introduced a no-op thet may even be optimized away by the compiler, failed to test it properly himself not discovering that 0 was still passed on through the system. Not that it mattered because the database procedure that eventually received the value was written to treat 0 and NULL the same for that value.
And the "too early" depends not only on your timezone but also on your latitude. Is it dark?