I know this can't be solved by the forum, but I wanted to just post it, as I can't find a solution without removing the code. It also could trigger somebody else with the same or similar problem.
My original line is below, and this fails with 'Failed invoking <symbol> UnexpectedTypeException: Expected String, given null'
values[valueIndex+1] = [heartrateToString(info.currentHeartRate)];
Now, I know, there's a few things that can go wrong here, so after some messing around, I changed to the code below, but still get the same error.
values[valueIndex+1] = null;
Again, the variables may be invalid, or the index too high, so using println, here's what I get:
Sys.println(valueIndex+1); returns 5
Sys.println(values.size()); returns 6
Sys.println(values[valueIndex+1]); returns null
So basically the index is in range and value is currently null, but when I try to set to any value (including null) I get the same error.
Even more weird, the line before the error is similar, and works perfectly.
values[valueIndex] = [heartrateToString(info.averageHeartRate)];
Basically, I am lost! Discuss.
Cheers
Chris