Calculated attributes bring down everything if not correct

Here’s another one:
I have a calculated attribute, code is this:

exposed function get foodprefs()->result : string

var prefs : string

if (this.cancook)

prefs = prefs + ((this.nopork==true) ? "NoPorc," : "")

prefs = prefs + ((this.nosugars==true) ? "NoSugar," : "")

prefs = prefs + ((this.microwaveonly==true) ? "MW," : "")

result = prefs

return result

This function seemingly does not work, and I can only assume that comparisons with attributes that are declared as Bool but were never initialized and are thus null lead to an error.

Even just one entity’s failed calculated attribute stops everything else, no data at all is displayed, no button works, everything is just not working.

Btw I first tried “prefs+ =” - that should work, I dont know if it does.

Somehow I keep returning to one of the major gripes: It is extremely hard to get to the bottom of erroneous code. And since there is seemingly little tolerance when it comes to attributes having unexpected values, it makes matters worse.

How much sense does it make to define an attribute with a type if an entity’s attributes are not properly initialized upon creation?

What makes this even more troublesome is that extending an entity with new attributes means that preexisting entities have attributes that are not properly initialized even if I initialize every new entity directly after creation.

there is an issue with error handling/messaging with mistyped/undefined/null that i think was already acknowledged. in 0.14.3, the debugger is your friend with that issue. you have to inspect everything, because you won’t get an error.
is the function, above, in the entity class for this dataclass? if it is in the dataclass, you might have an issue, since this won’t refer to the entity.

It is a function for the entity, and the debugger shows correct values for “this”.
But I’ll try again with the debugger.