Fix null dereference

Coverity ID 1061551