Hi,
This bug has been encountered before and it's a tricky one to diagnose on the outset. Hopefully this fix will work for you, and if not, I will continue to investigate more on my end.
Basically, when numbers are retrieved through Cloud Code, the JavaScript engine we use (RhinoJS) has some trouble using them with indexing in arrays.
A (silly) workaround for this is to Parse and Stringify the "cardName" variable.
cardName = JSON.stringify(JSON.parse(cardName))
See if this works for you and if not, I'll look for another solution. I've dealt with this error myself and it's frustrating :)
-Pádraig
One More Turn
So I'm doing the hearthstone tutorial and getting this error when running the action_pushCard challenge event. The variables are being defined fine until it reaches cardObj, derived from the array playerHand by the index cardName.
playerHand and cardName are defined just fine. But for some reason, cardObj is not? I have a screencap of the error below and the code as well.
Thanks for you time!