Fix crash when meeting null headers

(more to discover)