[IMG]file:///C:/DOCUME%7E1/raldana/Local%20Settings/Temp/moz-screenshot.jpg[/IMG][IMG]file:///C:/DOCUME%7E1/raldana/Local%20Settings/Temp/moz-screenshot-1.jpg[/IMG]Hi, I am learning visual studio .net with the following book:
Beginning Visual Basic® 2005
Thearon Willis and Bryan Newsome
On chapter 5 : Deleting from an ArrayList
Try it Out, Step 3
I write the following code accordingly to the instruction and I am getting a warning:
Property 'SelectedCustomer' does not return a value on all code paths. A null reference exception could occur at run time when the result is used
The question is why and how to fix this null issue?
Public ReadOnly Property SelectedCustomer() As Customer
GetIf lstCustomers.SelectedIndex <> -1 ThenâReturn the selected customer
Return lstCustomers.Items(lstCustomers.SelectedIndex)
End If
End Get
End Property
Thank you,
Ricardo