Can not assign a variable equals to nothing, If the variable is Global with System.exception type

Dear guys.

pls refer to the subject.
Studio Version is 2022.10.3
BR,
Donghai

Hey @donghai ,
Did you try by changing the scope of seTest2 to main ?
If you attempt to assign a value of “nothing” or “null” to a System.Exception global variable, you will get a compilation error. Instead, you can assign a default exception value or use a Try-Catch block to catch and handle exceptions in your workflow.

Regards,

Hi @donghai

In UiPath, if you have declared a global variable of type System.Exception, you cannot assign it a value null. This is because the System.Exception type is a reference type, which means that it is a pointer to a location in memory where the actual object data is stored.

Instead, can you try ‘Nothing’ & verify if it works for you?

Hope this helps,
Best Regards.

Hi @Jithesh_R

The variable seTest1’s scope is main.
I just test, I cann’t assign a global string variable equals to nothing also.

BR,

Hi @arjunshenoy

The same error with String Global variable.

BR,

I don’t understand the raised issue here. If you set it to Nothing it’s expected to throw exception.

Hi @alexandru

Throw exception only happened when the variable is Global, you can see my screenshot.
I think maybe it’s a bug.

BR,
Donghai

Dear all

I have tested that it’s regarding the studio version, above 23.4 is OK, under 23.4 will get an error.

BR,
Donghai

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