Object Reference not set to an instance of an object

  • 17 October 2006
  • 2 replies
  • 8 views

Badge +2
We are attempting to finish a worklist item from K2Rom, and the client event finishes successfully, but the subsequent server event errors with the following:

System.NullReferenceException: Object reference not set to an instance of an object.
at K2Code1029.Main(ServerEventContext K2)

This is due to the following, but can't figure out why.

K2.ActivityInstanceDestination.User (the User object is null)

Here is the server event code

public void Main(ServerEventContext K2)
{
K2.Synchronous = true;

// get the user id for the specific activity inst that occupied the one slot for this activity
K2.ProcessInstance.DataFields["IndividualUserName"].Value = K2.ActivityInstanceDestination.User.FQN;

}

2 replies

Badge +8
is this server event located in the same activity as the client event?
Badge +2
Yes, it is located in the same Activity, one right after the other.

Reply