I got this error from this code:

ERROR:
An unhandled exception of type 'System.NullReferenceException' occurred in Lap Time Analyser.exe

Additional information: Object reference not set to an instance of an object.

CODE:
VB Code:
  1. Private Sub btnplusminus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnplusminus.Click
  2.         Dim laptime() As String
  3.         Dim i, num As Integer
  4.         Dim sr As IO.StreamReader = IO.File.OpenText(path)
  5.         Do While (sr.Peek <> -1)
  6.             sr.ReadLine()
  7.             num += 1
  8.         Loop
  9.         sr.Close()
  10.         Dim srr As IO.StreamReader = IO.File.OpenText(path)
  11.         For i = 1 To num
  12.             laptime(i) = srr.ReadLine
  13.         Next
  14.         srr.Close()
  15.     End Sub

Im thinking its the laptime(i) that is screwing up because that is where it stops in the debugging tool. Help PLZ

My file looks like :

Alain
Ste-Julie
03
02
21
4/18/2006 5:25:14 PM