fix bug in checking the certs. thx danrl

Signed-off-by: Lehner Florian <dev@der-flo.net>
fix bug in setting NULL to textbuffers

Signed-off-by: Lehner Florian <dev@der-flo.net>