Strange Lightning Error: “Action failed: aura:if$controller$handleTheTruth”

In our Salesforce Lightning components we’re running into a very strange error:

Action failed: aura:if$controller$handleTheTruth [null is not an object (evaluating 'b.Aa')]
Failing descriptor: {aura:if$controller$handleTheTruth}

I have ran into this bug before and by process of elimination (desperately removing and adding code until I’ve found the line that causes the error) found that this was because of a aura:if. This makes the handleTheTruth part a bit more sense.

The isTrue statement had two parts (and(statement, statement)) and by again adding/removing statements, I found out that both statements worked individually, just not combined. So I then nested the aura:if‘s and to my surprise, it worked.

Now I’m running into the same error, but it only appears sporadically when modifying the data that is being iterated over. I’ve removed all the aura:if‘s in the iteration and it worked, but now it’s still giving the error message, no matter how I simplify the statement.

This is the aura:if component that throws the error. If I take it off, it works okay.

<aura:if isTrue="{!centre.isLeadingCC == true || p.pck.PackageType__c == 'Time' || p.pck.PackageType__c == 'Group'}">

I have checked the data and it checks out, I have tried just parts of the statement, but any of the three statements will throw the error.

Not sure if its relevant info, but the aura:if is nested under two aura:iterations.

I have also tried looking into the data, since it says null is not an object, but all the data seems to check out and no nulls are to be found.

I am really not sure what is going on, or what the message means. The actual code is quite a bit to post, so I’m wondering if anyone has ran into this error before and know what is going on?

Thanks for any help or pointers!


Source : Link , Question Author : joshuadelange , Answer Author : Community

Leave a Comment