5

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!

6
  • 4
    So it can't handleTheTruth? That's interesting.
    – sfdcfox
    Commented May 2, 2017 at 14:46
  • As described below, handleTheTruth is the controller method called when an aura:if is evaluated to true (obviously this is not part of the public API and could change at any moment). Without more code though, it's hard to say what's the problem: twitter.com/GrayJustise/status/852596982971416576 Commented May 2, 2017 at 15:54
  • @FabienTaillon I've added the faulty aura:if and a bit more context on the code. It's a big component so I'm not really sure what parts are most relevant to post. Commented May 3, 2017 at 10:40
  • try <aura:if isTrue="{!true == true}"> - is this ok? Commented May 4, 2017 at 7:54
  • Yes, try 3 things: test with a basic isTrue formula, try to remove everything from inside your aura:if tag, and try removing your aura:if from the iteration (if you can easily). Do you have a else ? Commented May 4, 2017 at 14:25

0

You must log in to answer this question.

Browse other questions tagged .