This is a migrated thread and some comments may be shown as answers.

Object reference not set to an instance of an object

1 Answer 587 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ronald
Top achievements
Rank 1
Veteran
Ronald asked on 01 Apr 2021, 07:51 PM

During rendering I often get this error. Sometimes I am able to find what mistake I made and fix it. But from the stacktrace in the Chrome debugger it is hard to figure out what is going on. I am working on a WASM project. I was wondering if there were any tips on how to debug issues like this?

 

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 05 Apr 2021, 04:29 PM

Hello Ronald,

The best idea I can offer, in case the stack trace and debugging don't help, is to try adding a few Console.WriteLine() calls in the lifecycle methods of your component. This will show you how far you get before seeing the exception so you can narrow down the search.

Another approach with a similar effect is to trim down code to do kind of a binary search - if you remove roughly half the code and the error stops manifesting, it was probably something in that half, so you can repeat the process.

Regards,
Marin Bratanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
General Discussions
Asked by
Ronald
Top achievements
Rank 1
Veteran
Answers by
Marin Bratanov
Telerik team
Share this question
or