UserProfile.getHeartRateZones crash when accessing return array

As you can see I get a crash when accessing the heart rate zones - this happens with a test app on my own device and it happens very rarely - my WF ran for a day while displaying the heartrate as complication...

Any ideas why this can happen?

1) Is it possible that UserProfile.getHeartRateZones may return null at some point?

2) can I rely on the docs regarding function return types like e.g. the on here: https://developer.garmin.com/connect-iq/api-docs/Toybox/UserProfile.html#getHeartRateZones-instance_function

It says the function can't return null - is that a guarantee?

  • I will try logging the exception ...

    Ok, good luck! 

    Is there a reason you can’t log the result of getHeartRateZones() though? If you’re worried about logging too much data, you could log the zones only when an exception occurs. I do think it’s also a good idea to log the exception.