Fixed testnet segfault issue causes by null pointer