usvpn Posted November 8, 2010 Posted November 8, 2010 (edited) See also, XVBT Hi, I use: Dim MyArray() As String = = EmailMessage.GetHeaderField("Disposition-Notification-To") EmailMessage is a 3rd party component, now it may or may not have anything, so the array is null/nothing in that case. In that case, any operation on array will return System.NullReferenceException Even if I want to check if the array : If MyArray IsNot Nothing or If MyArray.Length = 0 All will result in System.NullReferenceException How to check such an array at all? Thanks. Edited November 8, 2010 by snarfblam Quote
joe_pool_is Posted January 4, 2011 Posted January 4, 2011 First, get rid of the double equals (==). That is 'C' syntax. Next, have you tried the logic backwards and using parenthesis? If (MyArray Is Nothing) Then Return End If ' Process your code here Quote Avoid Sears Home Improvement
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.