Skip to content

Commit

Permalink
DYN-6995 Crash When Changing Language (#15254)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertGlobant20 authored May 28, 2024
1 parent 6695bdb commit 5cb57c8
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,14 @@ private void GroupInsertedGraph(List<AnnotationViewModel> existingGroups, string
var annotationViewModel = DynamoViewModel.CurrentSpaceViewModel.Annotations
.First(x => x.AnnotationModel == annotation);

var styleItem = annotationViewModel.GroupStyleList.First(x => x.Name.Equals(DynamoProperties.Resources.GroupStyleDefaultReview));
GroupStyleItem styleItem = null;
//This will try to find the GroupStyle review
styleItem = annotationViewModel.GroupStyleList.OfType<GroupStyleItem>().FirstOrDefault(x => x.Name.Equals(DynamoProperties.Resources.GroupStyleDefaultReview));
if(styleItem == null)
{
//If no GroupStyle is found matching the specific criteria we will use the first one
styleItem = annotationViewModel.GroupStyleList.OfType<GroupStyleItem>().First();
}
var groupStyleItem = new GroupStyleItem {Name = styleItem.Name, HexColorString = styleItem.HexColorString};
annotationViewModel.UpdateGroupStyle(groupStyleItem);

Expand Down

0 comments on commit 5cb57c8

Please sign in to comment.