Handling missing exception error


« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by John C on 10th July 2017
Sometimes my code won't have access to the data that my RGraph charts needs. That's OK, it's normal. However, RGraph common and key requires something or you get this error:

0x800a138f - JavaScript runtime error: Unable to get property 'length' of undefined or null reference

I'm fine handling this in C# with a Try/Catch, but I don't want to just Catch Exception or it'll take ALL exceptions - even ones I haven't accounted for. If I do that, I won't be sure it's this problem. What is the specific Exception type that this generates, so I can designate my code to specifically know it's this error?

- John C
Posted by Richard on 10th July 2017
Hi there,

RGraph doesn't use exceptions.

For the data: If you don't have any data instead of giving null you could try passing an empty array.

What chart was this? Was it null data or are you passing null to the key property?


Richard
Posted by John C on 13th July 2017
I figured out the issue, thank you.

Add a reply




« Back to message list