MailWindow: Add try/catch block around document creation
This commit is contained in:
@ -427,6 +427,7 @@ namespace Elwig.Windows {
|
||||
var memberDocs = recipients.Select(m => new {
|
||||
Member = m,
|
||||
Docs = docs.SelectMany<SelectedDoc, GeneratedDoc>(doc => {
|
||||
try {
|
||||
if (doc.Type == DocType.Custom) {
|
||||
return [new GeneratedDoc((string)doc.Details!)];
|
||||
} else if (doc.Type == DocType.MemberDataSheet) {
|
||||
@ -463,6 +464,10 @@ namespace Elwig.Windows {
|
||||
} else {
|
||||
throw new NotImplementedException("Invalid DocType");
|
||||
}
|
||||
} catch (Exception exc) {
|
||||
MessageBox.Show(exc.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
return [];
|
||||
}
|
||||
}).ToList()
|
||||
}).ToList();
|
||||
|
||||
|
Reference in New Issue
Block a user