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

VS 2010 [RESOLVED] NullReferenceException occured. Was working until I made some changes

$
0
0
I used to be able to call an event that was within a different class. I then made everything in my main class and am using a background thread to do all the work while the main thread is on an infinit timeout(to keep my service running in debug mode, so it doesn't close.)

The issue is that when I raise the event that I was raising before, it throws an error on the line below:
vbNET Code:
  1. CType(Me.Events("PullSubscriptionChangeEvent"), pullSubscriptionEventHandler).Invoke(subscription, itemEvents, _emailService)


This is how I am calling it.

vbNET Code:
  1. If Not ItemEvents Is Nothing Then
  2.  
  3.                 RaiseEvent PullSubscriptionChange(_pullSubscription, ItemEvents, _emailService)
  4.                 Debug.Print("ItemEvents: {0}", ItemEvents.Count)
  5.             Else
  6.                 Debug.Print("No Changes")
  7.             End If

Viewing all articles
Browse latest Browse all 27350

Trending Articles



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