debugger icon indicating copy to clipboard operation
debugger copied to clipboard

Fix missing nullptr checks

Open xusheng6 opened this issue 8 months ago • 1 comments

The debugger codebase is known to have many missing nullptr checks. Although I originally believed that it is not worthwhile to try to fix them since they should not really be null at all (or it may indicate another big or issue), I recently ran into a case where a subtle difference in the interaction could cause a nullptr (and then a crash), which I did not think of: https://github.com/Vector35/debugger/commit/9334e78afc9ae683a15751c866ded5df80312407

The reason why we should really add this nullptr checks is that the debugger is dynamic in nature, and it is hard to always be smart to think of all of the possible interactions

xusheng6 avatar Apr 02 '25 08:04 xusheng6

There is only a need to add nullptr check on those objects that are dynamically acquired, if something is owned by a class, then there is no need to check for it

xusheng6 avatar Sep 09 '25 03:09 xusheng6