I have a partial view for editing a collection (most of which I've truncated here):
@using CustomSurveyTool.Models
@model Basiclife
<div class="editorRow">
    @using (Html.BeginCollectionItem(""))
    {
        <div class="form-horizontal">
            <div class="row">
                @Html.ValidationSummary(true, "", new { @class = "text-danger" })
                <div class="col-md-2">
                    @Html.LabelFor(model => model.Plantype, htmlAttributes: new { @class = "control-label" })
                    @Html.EditorFor(model => model.Plantype, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.Plantype, "", new { @class = "text-danger" })
                </div>
                <div class="col-md-1">
                    <a href="#" class="deleteRow">X</a>
                </div>
            </div>
        </div>
    }
</div>
Which is part of a wrapper view:
@using CustomSurveyTool.Models
@model IEnumerable<Basiclife>
@{
    ViewBag.Title = "CreateBasicLifeResponse";
}
<h2>Basic Life Insurance Plans</h2>
<div id="planList">
    @using (Html.BeginForm())
    {
        <div id="editorRows">
            @foreach (var item in Model)
            {
                @Html.Partial("_BasicLifeResponse", item)
                }
        </div>
        @Html.ActionLink("Add", "BasicLifeResponse", null, new { id = "addItem", @class = "button" });
        <input type="submit" value="submit" />
    }
</div>
Which posts back to this controller:
    [HttpPost]
    public ActionResult CreateBasicLifeResponse(IEnumerable<Basiclife> model)
    {
        foreach(var item in model)
        {
            string currentUserId = User.Identity.GetUserId();
            Response targetresponse = db.response.FirstOrDefault(x => x.Userid == currentUserId);
            int responseid = targetresponse.Id;
            item.ResponseId = responseid;
            db.basiclife.Add(item);
            db.SaveChanges();
        }
        List<Basiclife> basiclife = new List<Basiclife>();
        return View(model);
    }
I am getting a NullReferenceException on the foreach(var item in model) after submitting the form. What could be causing this?
 
    