mod_topic: check argument for NULL

Better safe than sorry.