Fixed a null pointer reference which could lead to a segfault.