Fix potential invalid pointer dereference