• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 212
  • Last Modified:

Byte Array Property

I have the following

    Set(ByVal value As Byte())
            If Not _mergeDocument.SequenceEqual(value) Then
                _mergeDocument = value
                If Not Loading Then
                    Validate("MergeDocument")
                End If
            End If
        End Set

The problem is when a value is first assigned I get an error saying first cannot be null
0
rocky050371
Asked:
rocky050371
  • 2
1 Solution
 
CodeCruiserCommented:
Change to


Set(ByVal value As Byte())
            If Not IsNothing(_MergeDocument) AndAlso _mergeDocument.SequenceEqual(value) Then
                _mergeDocument = value
                If Not Loading Then
                    Validate("MergeDocument")
                End If
            End If
        End Set
0
 
rocky050371Author Commented:
I am not sure that will work, the value by default is nothing, therefore when it is something it needs to be set
0
 
CodeCruiserCommented:
Oh yeah. Try this



Set(ByVal value As Byte())
     
            If IsNothing(_MergeDocument) Then
                _mergeDocument = value
            Else If Not _mergeDocument.SequenceEqual(value) Then
                _mergeDocument = value
                If Not Loading Then
                    Validate("MergeDocument")
                End If
            End If
        End Set
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now