Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27353

VS 2010 [RESOLVED] "Object reference not set to an instance of an object" Error

$
0
0
Hi,
I'm getting a "Object reference not set to an instance of an object" error in this code:

Code:

If InvWList.SelectedItem = Nothing And InvAList.SelectedItem = Nothing Then
            MsgBox("Select an item to drop")
        ElseIf InvEqItems.Items.Contains(InvWList.SelectedItem.ToString) Or InvEqItems.Items.Contains(InvAList.SelectedItem.ToString) Then
            MsgBox("You have to unequip the item you want to drop")
        Else
            invDropResult = MsgBox("Are you sure you want to drop " & InvWList.SelectedItem.ToString & "?", MsgBoxStyle.YesNo)
        End If

I already tried many ways to fix it but it didn't work, so I would really appreciate if You would help me solve this problem. Thanks in advance.

Viewing all articles
Browse latest Browse all 27353

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>