fix bug where null HTTP responses would cause crashes