p54: fix a null pointer dereference bug