operator_compare throwing NilObjectException

It does when BreakOnException is true.

Which I believe to be inadequate as I usually have this turned off and it shouldn’t matter.

As I wrote: I believe that the compiler is optimizing the re-use of helper in the elseif.

BreakOnException is exactly for that: you’ll have an exception on the correct line. Debugging with BreakOnException Off is wrong IMO.

But Xojo doesn’t optimize.

[quote=191246:@Brock Nash]But I can and i did.

The code works as long as you add a null check.

dim t1 as NullableString = "hello" dim t2 as NullableString dim helper as string = "hello" if t1 <> nil and t1 <> helper then Break elseif t2 <> nil and t2 <> helper then Break end
[/quote]
Sure
That doesn’t make it so you can compare a string to a nullable string.
It means you detect that an object reference is nil and avoid the comparison entirely - not quite the same thing.
It doesn’t convert “helper” to a nullable string or a nil value to a nullable string.

Quite literally you will ALWAYS have to do the check for nil which, given past posts of yours, I was expecting you to not want to have to do.
But you cannot avoid them.

[quote=191251:@Eli Ott]As I wrote: I believe that the compiler is optimizing the re-use of helper in the elseif.

BreakOnException is exactly for that: you’ll have an exception on the correct line. Debugging with BreakOnException Off is wrong IMO.[/quote]
Debugging code that may raise exceptions with it off is a lot like printf debugging
Most times it wont matter
But when it does you get no help from it
Just seems painful to not enable something that could help you out