tests: unit: add NULL-pointer check