I am using threads to read from a file and process content. I have the following code:
Dim line As String = Nothing
Dim result As String = Nothing
Dim solved As Boolean
While strReader.EndOfStream <> True
SyncLock strReader
line = strReader.ReadLine()
result = "ERROR"
End SyncLock
solved = False
While solved = False
result = Process(line)
If Not result.Contains("ERROR") Then
solved = True
End If
End While
//some code
End While
and it gives me that error at line: If Not result.Contains(“ERROR”) Then
with labels works fine but I read that they are bad for coding.
How can I get rid of this error? What am I doing wrong?
Thanks!
The error pretty much says it all
Is returning a null value. Fix
Process()to return a non-null value.Alternately you could do this