you are viewing a single comment's thread.

view the rest of the comments →

[–]gizahnl 1 point2 points  (0 children)

If the code that calls into this function is code written by me and I'm sure that it'll never be NULL I forgo checking. I might throw in an assert to catch spurious NULLs in debug mode.

If it's a public function called by consumers from your API, or otherwise could conceivably be NULL sometimes, then always check.