Skip to content

Commit 22beeaf

Browse files
committed
VIX-3791 Fix exception in Vixen export type
* Ensure the correct type is presented to the serializer. * Add exception handling logic to prevent crashes if the serialization fails
1 parent 257df07 commit 22beeaf

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/Vixen.Modules/Editor/TimedSequenceEditor/Forms/WPF/MarksDocker/Services/MarkImportExportService.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -547,10 +547,18 @@ public static async Task ExportMarkCollections(MarkExportType exportType, IList<
547547
IndentChars = "\t"
548548
};
549549

550-
DataContractSerializer ser = CreateSerializer(typeof(List<IMarkCollection>), false);
551-
var writer = XmlWriter.Create(saveFileDialog.FileName, xmlsettings);
552-
ser.WriteObject(writer, collections.Select(x => x.MarkCollection));
553-
writer.Close();
550+
try
551+
{
552+
DataContractSerializer ser = CreateSerializer(typeof(List<IMarkCollection>), false);
553+
var writer = XmlWriter.Create(saveFileDialog.FileName, xmlsettings);
554+
ser.WriteObject(writer, collections.Select(x => x.MarkCollection).ToList());
555+
writer.Close();
556+
}
557+
catch (Exception ex)
558+
{
559+
Logging.Error(ex,"An exception occured trying to export the mark collection");
560+
}
561+
554562
}
555563
}
556564

0 commit comments

Comments
 (0)