doc/examples: remove unneeded NULL checks