Save Image Object reference not set to an instance of an object

Save image activity is works fine when connected to vdi machine. However it throws the error when disconnect from vdi machine. Can someone please help!
Object reference not set to an instance of an object. at UiPath.Core.Activities.ScopeActivity.OnFaulted(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

If you are running your robot in a VM and you close RDP connection your robot will fail. Keep RDP Session Open while robot is running

even if I minimize the session its not working.

Check this:

Sorry, I am new to RPA. trying to learn new stuff. I have other processes which has screen scrapping and other activities which works in closed session except the save image activity is failing

Are you using Take Screenshot before Save Image? Check if Image variable is a valid object before save to file

yes, I am taking a screenshot before save image. How do I check for object validation?

Now I am getting “Value cannot be null.” text added to the error. I think this means I am trying to save null value but this save image activity work when session is open.

Maybe Take Screenshot needs a Interactive Session to work. :man_shrugging:

I will keep trying to figure out the solution. Thanks for hearing me out, Appreciate your help!