Skip to content

Commit

Permalink
fixed a bug where the type concept list was null when updating a place
Browse files Browse the repository at this point in the history
  • Loading branch information
Nityan Khanna committed Nov 28, 2017
1 parent dc83820 commit 321b125
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions OpenIZAdmin/Controllers/PlaceController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,12 @@ public ActionResult Edit(EditPlaceModel model)
model.Identifiers = place.Identifiers.Select(i => new EntityIdentifierModel(i.Key.Value, place.Key.Value)).ToList();
model.Relationships = place.Relationships.Select(r => new EntityRelationshipModel(r)).ToList();

// ensure the type concept list is not null
if (model.TypeConcepts == null)
{
model.TypeConcepts = new List<SelectListItem>();
}

// get the place type concepts
model.TypeConcepts.AddRange(this.placeConceptService.GetPlaceTypeConcepts().ToSelectList(this.HttpContext.GetCurrentLanguage(), c => c.Key == place.TypeConceptKey).ToList());

Expand Down

0 comments on commit 321b125

Please sign in to comment.