Check if req is NULL before dereferencing it.