Object reference not set to an instance of an object. Runtime execution error

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.NullReferenceException: Object reference not set to an instance of an object.
at lambda_method(Closure , ActivityContext )
at Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context) at System.Activities.CodeActivity1.InternalExecuteInResolutionContext(CodeActivityContext context)
at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance, Activity1 expressionActivity) at System.Activities.Variable1.PopulateDefault(ActivityExecutor executor, ActivityInstance parentInstance, Location location)
at System.Activities.ActivityInstance.ResolveVariable(Variable variable, ActivityExecutor executor)
at System.Activities.ActivityInstance.ResolveVariables(ActivityExecutor executor)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Keep getting above error while trying to Run.

Have assign all variables with respective variable types. However, it didn’t help. Please help to share your experience on solving this error.

Arguments have been insert as well.

@KahPou_Liew - (Object reference not set to an instance of an object) If this error occurs the value which you have assigned is null. Even you have assigned all the variables with respective variable types if the value is null then this error will come. Try to print each variable and check whether all the values assigned are coming or not.

Hi @llayaraja,

Appreciate your suggestion. However, I can’t even run the process, it will straight away pop up the error.

How can I print each variable in this case? Please advice. Thanks!

@KahPou_Liew - Can you please share the screen shot of your xaml. If you are not even able to run the process means initial step itself value is passing as null.

Regards,
Ilayaraja

@KahPou_Liew Have you Tried Debugging, So you can understand at which step the Error Occurs Clearly

Hi
Is there any variable in variable panel set with GLOBAL SCOPE under scope field but has no value in it
If so set the respective variable to its own container and not to the whole sequence

Cheers @KahPou_Liew

1 Like

I tried, but it failed when I trigger, which mean “Process Start” > Error Pop Up

@KahPou_Liew Can you send a Screenshot of the beginning of the workflow? :sweat_smile: or can you explain what is the first step in your process ?

1 Like

Guys, I’m not sure if this is the problem.

Can any look into it and tell me? Since the error is indicating my variable is null.

@KahPou_Liew I meant the Screenshot of the Workflow you built :sweat_smile: the screenshot you provided tells us that every variable has the value Nothing, Hence it is giving you the error

I’ve found out the root cause is because I’d assigned a Variable as name+"@email.com" by default and set it as a receiver within “Send SMTP Mail Message”.

After I’ve deleted it and input name+"@email.com" into Receiver’s “To” field instead of variable, it works as expected.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.