Undefined value for strings

Undefined value for strings

An extension is returning an undefined value for a text variable instead of "" value.
Since the null value for string is "", is that a bug?
I've tried to compare my variable just like that:
(myVariable= "")
the return value is false.
Why that?

Marcos -

I too would assume that it would auto-cast null to string.Empty.

One strong recommendation, if this is an extension you wrote, to initialize all output variables as the very first step in the routine to non-null values.

If this is not an extension you wrote, comparing it to NullObject() (you may need to pass that variable through ToObject() to make the comparison) may work.

Hi Justin!
That auto-cast is not working. Can someone from Outsystems check if this is a bug?
This is an extension that i wrote, but inside it i'm getting a string value returned by third party assembly, and that value is null in my test case.
To avoid that error i'm checking the null and converting to a string.Empty. But there are a lot of string variables that will be return to the OutSystems application. Is going to be a pain to check all that variables.